开发者社区> 问答> 正文

webpack 打包出错?报错

.babelrc文件

package文件

npm run dev不报错

build就编译失败了,求大神解答!

展开
收起
爱吃鱼的程序员 2020-06-06 15:44:17 670 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB
                        <ol>
    <li><code>es2015</code> preset doesn't transform <code>async functions</code>. Consider using <a rel="nofollow"><code>babel-preset-env</code></a>. Also, you can use <code>es2017</code> preset alongside <code>es2015</code> to convert everything to ES5, but it's generally better to use <code>babel-preset-env</code>.</li>
    <li>Using babili and uglify. I assume you're bundling/calling webpack as <code>webpack -p</code> as this includes Uglify Plugin as the last step. Also, you're using Babili in your babelrc. Uglify doesn't understand ES6 (<a rel="nofollow">uglify-es</a> does). Use only one minifier - it's not necessary to use both babili and Uglify.</li>
    <li>Using babili as another preset in babelrc. There are some <a rel="nofollow">issues</a> with babili when used along with es2015 preset, consider using <a rel="nofollow">babili-webpack-plugin</a> and do NOT run webpack with <code>webpack -p</code>as it includes UglifyJS. More about why to use babili-webpack-plugin is in its <a rel="nofollow">own docs</a>.</li>
    
                        <p>remove --optimize-minimize option</p>
    
    2020-06-06 15:44:31
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
基于webpack和npm的前端组件化实践 立即下载
SPARKLER,A web-crawler on Apache Spark 立即下载
WEB浏览器中即将发生的安全变化 立即下载