Closed sheweifan closed 5 years ago
webpack.config.js { egg: true, framework: 'vue', publicPath: 'http://xxx.cdn.com/public/', ... }
{ egg: true, framework: 'vue', publicPath: 'http://xxx.cdn.com/public/', ... }
报错: `yarn build yarn run v1.9.4 $ easywebpack build prod clean-webpack-plugin: /Users/xxx/public has been removed. webpack build [========== ] 10% (0.0 seconds){ parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }. webpack build [====================================================================================================] 100% (15.8 seconds)
Build completed in 15.771s
error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`
打包出来的mainfest.json { "app.css": "http://xxx.cdn.com/public/css/app.c2131bfb.css", "app.js": "http://xxx.cdn.com/public/js/chunk/app.3024194f.js", "runtime.js": "http://xxx.cdn.com/public/js/runtime.cdf3621f.js", "font/iconfont.css": "http://xxx.cdn.com/public/font/iconfont.ba9be85f.woff", "img/default-avatar.png": "http://xxx.cdn.com/public/img/default-avatar.bf66d842.png", "img/user-menu.vue": "http://xxx.cdn.com/public/img/icon-yixinli.61229039.png", "img/iconfont.css": "http://xxx.cdn.com/public/img/iconfont.d2a86037.svg", "img/list.vue": "http://xxx.cdn.com/public/img/no-artical.19d06407.png", "img/theme-entry.png": "http://xxx.cdn.com/public/img/theme-entry.619bb2b3.png", "vendor.js": "/public/js/vendor.1d4da928.js", "deps": { "app.js": { "js": [ "/public/js/vendor.1d4da928.js", "http://xxx.cdn.com/public/js/runtime.cdf3621f.js", "http://xxx.cdn.com/public/js/chunk/app.3024194f.js" ], "css": [ "http://xxx.cdn.com/public/css/app.c2131bfb.css" ] } }, "info": { "publicPath": "http://xxx.cdn.com/public/", "buildPath": "public", "mapped": true } }
{ "app.css": "http://xxx.cdn.com/public/css/app.c2131bfb.css", "app.js": "http://xxx.cdn.com/public/js/chunk/app.3024194f.js", "runtime.js": "http://xxx.cdn.com/public/js/runtime.cdf3621f.js", "font/iconfont.css": "http://xxx.cdn.com/public/font/iconfont.ba9be85f.woff", "img/default-avatar.png": "http://xxx.cdn.com/public/img/default-avatar.bf66d842.png", "img/user-menu.vue": "http://xxx.cdn.com/public/img/icon-yixinli.61229039.png", "img/iconfont.css": "http://xxx.cdn.com/public/img/iconfont.d2a86037.svg", "img/list.vue": "http://xxx.cdn.com/public/img/no-artical.19d06407.png", "img/theme-entry.png": "http://xxx.cdn.com/public/img/theme-entry.619bb2b3.png", "vendor.js": "/public/js/vendor.1d4da928.js", "deps": { "app.js": { "js": [ "/public/js/vendor.1d4da928.js", "http://xxx.cdn.com/public/js/runtime.cdf3621f.js", "http://xxx.cdn.com/public/js/chunk/app.3024194f.js" ], "css": [ "http://xxx.cdn.com/public/css/app.c2131bfb.css" ] } }, "info": { "publicPath": "http://xxx.cdn.com/public/", "buildPath": "public", "mapped": true } }
报错后文件根目录public文件夹丢失。 cdn配置项也是如此
@sheweifan 执行 easy clean 以后, 再构建试试。 CDN 地址建议用 cdn 节点配置(这个只在发布模式会生效)
@hubcarl 感谢回复
昨天改为cdn配置了,已经满足需求。但是和配置publicPath报一样的错误。 原因可能是dll的问题,因为修改了dll的name就可以顺利打包了。
刚刚又打包报错,尝试了easy clean有效。
webpack.config.js
{ egg: true, framework: 'vue', publicPath: 'http://xxx.cdn.com/public/', ... }
报错: `yarn build yarn run v1.9.4 $ easywebpack build prod clean-webpack-plugin: /Users/xxx/public has been removed. webpack build [========== ] 10% (0.0 seconds){ parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }. webpack build [====================================================================================================] 100% (15.8 seconds)
Build completed in 15.771s
error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`
打包出来的mainfest.json
{ "app.css": "http://xxx.cdn.com/public/css/app.c2131bfb.css", "app.js": "http://xxx.cdn.com/public/js/chunk/app.3024194f.js", "runtime.js": "http://xxx.cdn.com/public/js/runtime.cdf3621f.js", "font/iconfont.css": "http://xxx.cdn.com/public/font/iconfont.ba9be85f.woff", "img/default-avatar.png": "http://xxx.cdn.com/public/img/default-avatar.bf66d842.png", "img/user-menu.vue": "http://xxx.cdn.com/public/img/icon-yixinli.61229039.png", "img/iconfont.css": "http://xxx.cdn.com/public/img/iconfont.d2a86037.svg", "img/list.vue": "http://xxx.cdn.com/public/img/no-artical.19d06407.png", "img/theme-entry.png": "http://xxx.cdn.com/public/img/theme-entry.619bb2b3.png", "vendor.js": "/public/js/vendor.1d4da928.js", "deps": { "app.js": { "js": [ "/public/js/vendor.1d4da928.js", "http://xxx.cdn.com/public/js/runtime.cdf3621f.js", "http://xxx.cdn.com/public/js/chunk/app.3024194f.js" ], "css": [ "http://xxx.cdn.com/public/css/app.c2131bfb.css" ] } }, "info": { "publicPath": "http://xxx.cdn.com/public/", "buildPath": "public", "mapped": true } }
报错后文件根目录public文件夹丢失。 cdn配置项也是如此