解决[babel] note:the code generator has deoptimised the styling...

在使用webpack的babel-loader编译es6的js文件时,出现了如题的提示。

解决方法如下:

1 loaders: [
2     { test: /\.js$/, loader: 'babel', query: {compact: false} }
3 ]

或者:

1 {test: /\.js$/, loaders: ['babel?compact=false']}

注意:关键的地方在于babel-loader的compact参数设置,因为默认的compact值为'auto'。

posted @ 2016-02-14 13:28  wenston  阅读(23669)  评论(0编辑  收藏  举报