javascript - How to configure jshint in webpack.config file (webpack2.X)?
黄舟
黄舟 2017-05-16 13:42:30
0
1
571

This is what was written in the webpack.config file before using webpack1.X

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代码??
黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(1)
伊谢尔伦
module:{
    rules:[
       {
            test: /\.(jsx|js)/,
            use: {
                loader:'jshint-loader',
                options: {esnext: true}
            },
            enforce: 'pre',
            include: APP_PATH,
            exclude: /node_modules/
        }
    ]
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template