webpack打包压缩时命令行报错(avalon2)
webpack打包压缩时,报错关于avalon2
命令行运行 webpack -p(webpack打包、压缩css js 文件命令)后:
cMacBook-Air:cmyWorks WZJS-CMY$ webpack -p
clean-webpack-plugin: /Users/chenmeiyuan1/Documents/quanTong/qky-xyzk-frontend/cmyWorks/dist has been removed.
Hash: ff4916f755c1312d69b6
Version: webpack 1.13.1
Time: 6068ms
Asset Size Chunks Chunk Names
js/index2016y7m15d8h57m795.js 199 kB 0 [emitted] index
css/index2016y7m15d8h57m795.css 1.08 MB 0 [emitted] index
./html/index.html 933 bytes [emitted]
[0] ./dev/js/webpack/index.js 169 bytes {0} [built]
[1] ./dev/js/common/public.js 189 bytes {0} [built]
[2] ./dev/js/json/findLimitFruits.js 503 bytes {0} [built]
[3] ./dev/js/json/findLimitPractices.js 521 bytes {0} [built]
[4] ./dev/js/json/indexjson.js 951 bytes {0} [built]
[5] ./dev/js/webpack/common.js 84 bytes {0} [built]
+ 13 hidden modules
WARNING in js/index2016y7m15d8h57m795.js from UglifyJs
Condition always true [./~/avalon2/dist/avalon.js:10,0]
Dropping unreachable code [./~/avalon2/dist/avalon.js:12,0]
Side effects in initialization of unused variable eventCache [./~/avalon2/dist/avalon.js:3931,0]
Side effects in initialization of unused variable markID [./~/avalon2/dist/avalon.js:3933,0]
Dropping unused variable rfilters [./~/avalon2/dist/avalon.js:3935,0]
Dropping unused variable rfilters [./~/avalon2/dist/avalon.js:3939,0]
Dropping unused variable rvar [./~/avalon2/dist/avalon.js:3940,0]
Dropping unused variable rstring [./~/avalon2/dist/avalon.js:3941,0]
Dropping unused variable domTemplate [./~/avalon2/dist/avalon.js:5341,0]
Dropping unused function isEmptyObject [./~/avalon2/dist/avalon.js:5402,0]
Side effects in initialization of unused variable stringify [./~/avalon2/dist/avalon.js:5125,0]
Side effects in initialization of unused variable a [./~/avalon2/dist/avalon.js:6318,0]
Dropping unused variable emptyArr [./~/avalon2/dist/avalon.js:6859,0]
Condition always true [./~/jquery/dist/jquery.js:10972,0]
Child html-webpack-plugin for "html/index.html":
+ 3 hidden modules
Child extract-text-webpack-plugin:
+ 6 hidden modules
报错代码为:
WARNING in js/index2016y7m15d8h57m795.js from UglifyJs
Condition always true [./~/avalon2/dist/avalon.js:10,0]
Dropping unreachable code [./~/avalon2/dist/avalon.js:12,0]
Side effects in initialization of unused variable eventCache [./~/avalon2/dist/avalon.js:3931,0]
Side effects in initialization of unused variable markID [./~/avalon2/dist/avalon.js:3933,0]
Dropping unused variable rfilters [./~/avalon2/dist/avalon.js:3935,0]
Dropping unused variable rfilters [./~/avalon2/dist/avalon.js:3939,0]
Dropping unused variable rvar [./~/avalon2/dist/avalon.js:3940,0]
Dropping unused variable rstring [./~/avalon2/dist/avalon.js:3941,0]
Dropping unused variable domTemplate [./~/avalon2/dist/avalon.js:5341,0]
Dropping unused function isEmptyObject [./~/avalon2/dist/avalon.js:5402,0]
Side effects in initialization of unused variable stringify [./~/avalon2/dist/avalon.js:5125,0]
Side effects in initialization of unused variable a [./~/avalon2/dist/avalon.js:6318,0]
Dropping unused variable emptyArr [./~/avalon2/dist/avalon.js:6859,0]
Condition always true [./~/jquery/dist/jquery.js:10972,0]
好像大部分的错误都在avalon2这个文件里?
我是通过npm install avalon2命令安装avalon2的。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
UglifyJs会分析JS代码,自动删除里面一些用不着的代码,比如声明而不用的变量(Dropping unused variable)、恒为TRUE的if语句(Condition always true)、return语句后的代码(Dropping unreachable code),以达到缩减JS尺寸的效果。不影响后续JS执行的,因此不必刻意在意这些WARNING。
你这样无法调试啊?