unplugin / unplugin-vue-components

📲 On-demand components auto importing for Vue
https://www.npmjs.com/package/unplugin-vue-components
MIT License
3.74k stars 349 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 1 year ago

got same problem

aWestbrookFan commented 12 months ago

got same problem

howiepu commented 10 months ago

got same problem

howiepu commented 10 months 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 1 month ago

got same problem