unplugin-vue-components icon indicating copy to clipboard operation
unplugin-vue-components copied to clipboard

In vite library mode, enable global and external in rollupOptions and add ant-design-vue, which will still be packaged into the product

Open hcg1023 opened this issue 3 years ago • 6 comments

In vite library mode, enable global and external in rollupOptions and add ant-design-vue, which will still be packaged into the product

https://github.com/hcg1023/vite-unplugin-vue-components-bug

build: {
		target: 'es2015',
		lib: {
			entry: path.resolve(process.cwd(), `src/index.ts`),
			name: 'CustomControl',
			formats: ['umd'],
			fileName: 'CustomControl',
		},
		cssCodeSplit: true,
		rollupOptions: {
			external: [
				'vue',
				'ant-design-vue',
			],
			output: {
				globals: {
					vue: 'Vue',
					'ant-design-vue': 'antd',
				},
			},
		},
	}

hcg1023 avatar Feb 17 '22 10:02 hcg1023

got same problem

SGB555 avatar Mar 04 '22 06:03 SGB555

got same problem

bigfacewo avatar Oct 07 '22 13:10 bigfacewo

got same problem

aWestbrookFan avatar Sep 09 '23 07:09 aWestbrookFan

got same problem

howiepu avatar Nov 02 '23 12:11 howiepu

Tried to use 'external: [/xx/]' writing and found that it can be done, but I don't know if there will be any other problems

howiepu avatar Nov 06 '23 01:11 howiepu