您的位置:首页技术文章
文章详情页

javascript - jshint在webpack.config文件中怎么配置(webpack2.X)?

【字号: 日期:2023-09-14 09:42:04浏览:26作者:猪猪

问题描述

以前用webpack1.X时候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代码??

问题解答

回答1:

module:{ rules:[ { test: /.(jsx|js)/, use: {loader:’jshint-loader’,options: {esnext: true} }, enforce: ’pre’, include: APP_PATH, exclude: /node_modules/} ]}

标签: JavaScript
相关文章: