以前用webpack1.X时候webpack.config文件中是这样写的npm install jshint-loader --save-devvar path = require('path');var APP_PATH = path.resolve(ROOT_PATH, 'app');module: { preLoaders: [ { test: /\.jsx?$/, include: APP_PATH, loader: "jshint-loader" } ], jshint: { "esnext": true }}现在webpack2.X preLoaders跟jshint的写法都变了,我应该怎么修改下config代码??
1 回答
小唯快跑啊
TA贡献1863条经验 获得超2个赞
module:{
rules:[
{
test: /\.(jsx|js)/,
use: {
loader:'jshint-loader',
options: {esnext: true}
},
enforce: 'pre',
include: APP_PATH,
exclude: /node_modules/
}
]
}
添加回答
举报
0/150
提交
取消