赞
踩
vue3+vite4生产环境production打包报错:
NODE_ENV=production is not supported in the .env file. Only NODE_ENV=development is supported to create a development build of your project. If you need to set process.env.NODE_ENV, you can set it in the Vite config instead.
大致意思就是:
NODE_ENV=.ENV文件中不支持生产。仅支持NODE_ENV=开发来创建项目的开发构建。如果需要设置process.env.NODE_env,则可以在Vite配置中进行设置。
**
**
如果有警告
build.terserOptions is specified but build.minify is not set to use Terser. Note Vite now defaults to use esbuild for minification. If you still prefer Terser, set build.minify to "terser".
那就把vite.config.js里面的minify换成:terser(别忘记install下载了)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。