Heim > Fragen und Antworten > Hauptteil
Als ich webpack1.X verwendet habe, stand Folgendes in der Datei webpack.config
npm install jshint-loader --save-dev
var 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代码??
伊谢尔伦2017-05-16 13:44:30
module:{
rules:[
{
test: /\.(jsx|js)/,
use: {
loader:'jshint-loader',
options: {esnext: true}
},
enforce: 'pre',
include: APP_PATH,
exclude: /node_modules/
}
]
}