Skip to content

Latest commit

 

History

History

complex-types

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

@vue.ts/complex-types

NPM version

Use @vue/language-core to support complex types for Vue Macros.

For example: fixes vuejs/core#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
// 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 */
		}),
	],
});


📚 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

📝 License

MIT. Made with ❤️ by Ray