我使用 Vue CLI 3 创建了一个新项目(配置:babel、pwa、eslint、mocha)。使用 npm run serve
运行测试环境工作正常,但我无法构建用于生产的项目。
我安装了当前版本的 Vue CLI 3 并尝试创建具有不同配置的项目。我在构建项目时收到以下错误消息。
js/app.bb3f3c6e.js from Terser
TypeError: Cannot read property 'minify' of undefined
at minify (/Users/.../untitled/node_modules/terser-webpack-plugin/dist/minify.js:176:23)
at module.exports (/Users/.../untitled/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
at handle (/Users/.../untitled/node_modules/worker-farm/lib/child/index.js:44:8)
at process.<anonymous> (/Users/.../untitled-adventure/node_modules/worker-farm/lib/child/index.js:51:3)
at process.emit (events.js:188:13)
at emit (internal/child_process.js:828:12)
at processTicksAndRejections (internal/process/next_tick.js:76:17)
最佳答案
关于vue.js - 构建新的 Vue CLI 3 项目时,如何修复 terser-webpack-plugin 中的 'TypeError: Cannot read property ' minify' of undefined'?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54498587/