-
Notifications
You must be signed in to change notification settings - Fork 340
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
构建报UglifyJs错误 #890
Comments
I have the same issue here, I wanted to use TypeScript to some part of my project that made with Javascript/React. It went well on the local environment, but when I build them with Roadhog, it cause some problem like this. I wish there were more information for English as well. My service had built like 3 years ago and grew up as a big service. it is really hard to migrate or update with some new service because RoadHog seems like stoped updating. Please Give some help on it. |
同错误,3年半以前pro v1 项目,2年前从roadhog版本从2.4.(也是编译错误) 升级到 2.5.0-beta.4 ,老项目过大,升级v4,时间跟改造成本太高,纠结中, |
同错误 |
可以看下是哪个库有es6语法,然后再extraBabelIncludes里面增加配置,例如下面的
|
Environment(required) | 环境(必填)
What did you do? Please provide steps to re-produce your problem.(请提供复现步骤)
npm run build:dev的时候报错误:Failed to minify the bundle. Error: index.60e242d9.js from UglifyJs
Unexpected token operator «=», expected punc «,» [index.60e242d9.js:586539,48]
经查询是crypto-js包没有编译成es5,导致UglifyJs压缩js时报错。
在webpackrc.js中引入了extraBabelIncludes,但是没有效果
export default { entry: 'src/index.js', extraBabelPlugins: [['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }]], extraBabelIncludes:['./node_modules/crypto-js'], env: { development: { extraBabelPlugins: ['dva-hmr'], }, },
What do you expected?(预期的正常效果)
在在webpackrc.js中引入了extraBabelIncludes应该要正常编译该crypto-js包
What happen?(发生了何种非正常现象)
npm run build:dev的时候报错误:Failed to minify the bundle. Error: index.60e242d9.js from UglifyJs
Unexpected token operator «=», expected punc «,» [index.60e242d9.js:586539,48]
Re-producible online demo (可复现的在线demo)
1
The text was updated successfully, but these errors were encountered: