JeecgBoot是一个不错的低代码平台,使用的版本是2.4.6。

打包正式版本命令如下:

npm run build:production

但是失败了,非production可以打包成功,但是环境变量解析不到,报错如下:

> ddjx@1.0.7 build:prod
> vue-cli-service build --mode production


⠋  Building for production... ERROR  TypeError: Class extends value undefined is not a constructor or null
TypeError: Class extends value undefined is not a constructor or null
    at Object.<anonymous> (/Users/xxxxxx/Desktop/Projects/jeecg-boot v2.4.6/ant-design-vue-jeecg/node_modules/mini-css-extract-plugin/dist/CssDependency.js:12:46)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/xxxxxx/Desktop/Projects/jeecg-boot v2.4.6/ant-design-vue-jeecg/node_modules/mini-css-extract-plugin/dist/index.js:12:45)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/xxxxxx/Desktop/Projects/jeecg-boot v2.4.6/ant-design-vue-jeecg/node_modules/mini-css-extract-plugin/dist/cjs.js:3:18)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)

解决办法如下:

npm add webpack@4.4.1

Logo

基于 Vue 的企业级 UI 组件库和中后台系统解决方案,为数万开发者服务。

更多推荐