unplugin / unplugin-vue-components

📲 On-demand components auto importing for Vue
https://www.npmjs.com/package/unplugin-vue-components
MIT License
3.85k stars 353 forks source link

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

Open hcg1023 opened 2 years ago

hcg1023 commented 2 years ago

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',
                },
            },
        },
    }
SGB555 commented 2 years ago

got same problem

bigfacewo commented 2 years ago

got same problem

aWestbrookFan commented 1 year ago

got same problem

howiepu commented 1 year ago

got same problem

howiepu commented 1 year ago

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

wq-ws commented 4 months ago

got same problem