问题1:TypeError: Cannot read property 'minify' of undefined
1.参考文章 https://github.com/vuejs/vue-cli/issues/3407
2.上面文章说是个bug,
3.package-lock.json 下terser与terser-webpack-plugin要对应修改成
"terser": {
"version": "3.16.1",
"resolved": "http://registry.npm.taobao.org/terser/download/terser-3.16.1.tgz",
"integrity": "sha1-Ww3U+h/9CwtDwkk7LDZP0XkWBJM=",
"dev": true,
"requires": {
"commander": "~2.17.1",
"source-map": "~0.6.1",
"source-map-support": "~0.5.9"
},
"dependencies": {
"source-map": {
"version": "0.6.1",
"resolved": "http://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz",
"integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=",
"dev": true
}
}
},
"terser-webpack-plugin": {
"version": "1.2.2",
"resolved": "http://registry.npm.taobao.org/terser-webpack-plugin/download/terser-webpack-plugin-1.2.2.tgz",
"integrity": "sha1-m/86iRrWFIVafd4NcH99takn49k=",
"dev": true,
"requires": {
"cacache": "^11.0.2",
"find-cache-dir": "^2.0.0",
"schema-utils": "^1.0.0",
"serialize-javascript": "^1.4.0",
"source-map": "^0.6.1",
"terser": "^3.16.1",
"webpack-sources": "^1.1.0",
"worker-farm": "^1.5.2"
},
4.然后 去项目录下,npm install
输出结果:
updated 2 packages and audited 26088 packages in 7.675s
found 0 vulnerabilities
你在build看看
5.还方法就是从新用Vue cli生成一个新的项目,看是否可以build出 dist,可以的话参考当时的package-lock.json