Skip to content

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

@hcg1023

Description

@hcg1023

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',
				},
			},
		},
	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions