@vue.ts/complex-types
v0.6.0
Published
Resolve complex types in Vue SFCs.
Downloads
378
Maintainers
Readme
@vue.ts/complex-types
Use @vue/language-core
to support complex types for Vue Macros.
For example: fixes https://github.com/vuejs/core/issues/8286.
📦 Installation
$ npm install -D @vue.ts/complex-types
$ yarn add -D @vue.ts/complex-types
$ pnpm add -D @vue.ts/complex-types
TODOs
- [ ] Add more tests
🚀 Usage
// vite.config.ts
import VueComplexTypes from "@vue.ts/complex-types/vite";
export default defineConfig({
plugins: [
VueComplexTypes({
/* options */
}),
],
});
// rollup.config.js
import VueComplexTypes from "@vue.ts/complex-types/rollup";
export default {
plugins: [
VueComplexTypes({
/* options */
}),
// other plugins
],
};
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require("@vue.ts/complex-types/webpack")({
/* options */
}),
],
};
// rspack.config.js
module.exports = {
/* ... */
plugins: [
require("@vue.ts/complex-types/rspack")({
/* options */
}),
],
};
// nuxt.config.ts
export default defineNuxtConfig({
modules: ["@vue.ts/complex-types/nuxt"],
complexTypes: {
/* options */
},
});
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require("@vue.ts/complex-types/webpack")({
/* options */
}),
],
},
};
// quasar.conf.js [Vite]
module.exports = {
vitePlugins: [
[
"@vue.ts/complex-types/vite",
{
/* options */
},
],
],
};
// quasar.conf.js [Webpack]
const VueComplexTypesPlugin = require("@vue.ts/complex-types/webpack");
module.exports = {
build: {
chainWebpack(chain) {
chain.plugin("@vue.ts/complex-types").use(
VueComplexTypesPlugin({
/* options */
}),
);
},
},
};
// esbuild.config.js
import { build } from "esbuild";
build({
/* ... */
plugins: [
require("@vue.ts/complex-types/esbuild")({
/* options */
}),
],
});
// astro.config.mjs
import VueComplexTypes from "@vue.ts/complex-types/astro";
export default defineConfig({
integrations: [
VueComplexTypes({
/* options */
}),
],
});
📚 Options
tsconfigPath
Path to your tsconfig.json
.
- Type:
string
- Default:
path.join(process.cwd(), "tsconfig.json")
defineEmits
Transform defineEmits
or not.
- Type:
boolean
- Default:
true
defineProps
Transform defineProps
or not.
- Type:
boolean
- Default:
true