vitejs / vite

Next generation frontend tooling. It's fast!
http://vite.dev
MIT License
69.07k stars 6.24k forks source link

vite2.9.15 + ant-design-vue1.7.8 + vue2 build after ERROR:Uncaught ReferenceError: Antd is not defined #9894

Closed a309492165 closed 2 years ago

a309492165 commented 2 years ago

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

github-actions[bot] commented 2 years ago

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.