-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm run dist 失败,ci 失败 #1360
Comments
es下的文件没经过babel转码? |
我以为es和lib的目录只是使用 es6 module 而已,语法还是编译过后的 es5? |
@paranoidjk 我看编译后貌似不是 es5了,会有 import export 等 我尝试了在自定义 webpack.config 里覆盖 UglifyJsPlugin 也没能搞定,囧 |
只有 import 和 export 这个 module syntax, 其他 es6 语法还是转了的 另外,es 目录下的不是不经过 uglify 吗? |
@paranoidjk dist 是打包 antd-mobile.min.js |
打 antd-mobile.min.js umd bundle 的时候不应该牵扯 es 吧?保持原来的逻辑就好了,src -> babel -> lib -> webpack + uglify > min.js |
@paranoidjk 现在的貌似是走的 src -> babel -> es -> webpack + uglify > min.js |
|
去掉uglify plugin之后build success, 但是 bundle 并不是有效的 umd,还是一堆 import '../components/xx' |
这个 close. @warmhug 应该已经 fix 了,记得来这里把原因写下。 |
本地运行“npm run dist”会报错,“Failed at the antd-mobile@1.1.4-beta.4 dist script 'BABEL_ENV=dist antd -tools run dist'.” |
@saiyagg |
删除BABEL_ENV=dist后,脚本执行正确。 |
@squallvince 看下 node npm 版本是否太老了。 原来报错原因主要有两点:
|
排查了哈原因:大概是因为 uglifyjs-webpack-plugin 目前不支持 es 的压缩,
webpack-contrib/uglifyjs-webpack-plugin#33
https://github.com/mishoo/UglifyJS2/tree/harmony
The text was updated successfully, but these errors were encountered: