Use @vue/language-core
to support complex types for Vue Macros.
For example: fixes vuejs/core#8286.
$ npm install -D @vue.ts/complex-types
$ yarn add -D @vue.ts/complex-types
$ pnpm add -D @vue.ts/complex-types
- Add more tests
Vite
// vite.config.ts
import VueComplexTypes from "@vue.ts/complex-types/vite";
export default defineConfig({
plugins: [
VueComplexTypes({
/* options */
}),
],
});
Rollup
// rollup.config.js
import VueComplexTypes from "@vue.ts/complex-types/rollup";
export default {
plugins: [
VueComplexTypes({
/* options */
}),
// other plugins
],
};
Webpack
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require("@vue.ts/complex-types/webpack")({
/* options */
}),
],
};
Rspack
// rspack.config.js
module.exports = {
/* ... */
plugins: [
require("@vue.ts/complex-types/rspack")({
/* options */
}),
],
};
Nuxt
// nuxt.config.ts
export default defineNuxtConfig({
modules: ["@vue.ts/complex-types/nuxt"],
complexTypes: {
/* options */
},
});
Vue CLI
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require("@vue.ts/complex-types/webpack")({
/* options */
}),
],
},
};
Quasar
// 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
// esbuild.config.js
import { build } from "esbuild";
build({
/* ... */
plugins: [
require("@vue.ts/complex-types/esbuild")({
/* options */
}),
],
});
Astro
// astro.config.mjs
import VueComplexTypes from "@vue.ts/complex-types/astro";
export default defineConfig({
integrations: [
VueComplexTypes({
/* options */
}),
],
});
Path to your tsconfig.json
.
- Type:
string
- Default:
path.join(process.cwd(), "tsconfig.json")
Transform defineEmits
or not.
- Type:
boolean
- Default:
true
Transform defineProps
or not.
- Type:
boolean
- Default:
true