Closed a309492165 closed 2 years ago
开发使用的时候正常,打包后ERROR:Uncaught ReferenceError: Antd is not defined vite.config.js import createImportPlugin from 'vite-plugin-import' createImportPlugin({ onlyBuild: true, // 是否只需要在生产环境中使用 babelImportPluginOptions: [ { libraryName: 'ant-design-vue', libraryDirectory: 'es', style: 'css', // or 'css' }, ], }),
import createImportPlugin from 'vite-plugin-import' createImportPlugin({ onlyBuild: true, // 是否只需要在生产环境中使用 babelImportPluginOptions: [ { libraryName: 'ant-design-vue', libraryDirectory: 'es', style: 'css', // or 'css' }, ], }),
期待正常运行
No response
Hello @a309492165. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.
need reproduction
Description
开发使用的时候正常,打包后ERROR:Uncaught ReferenceError: Antd is not defined vite.config.js
import createImportPlugin from 'vite-plugin-import' createImportPlugin({ onlyBuild: true, // 是否只需要在生产环境中使用 babelImportPluginOptions: [ { libraryName: 'ant-design-vue', libraryDirectory: 'es', style: 'css', // or 'css' }, ], }),
Suggested solution
期待正常运行
Alternative
No response
Additional context
No response
Validations