剛剛新建了一個(gè)webpack demo,想使用jshint來(lái)檢測(cè)自己的js代碼,發(fā)現(xiàn)總是提示Cannot find module 'jshint在執(zhí)行多次的npm install jshint-loader --save-dev依然報(bào)錯(cuò),作為新手想讓大家?guī)臀页虺?!module代碼如下:module.exports = {module: {loaders: [ { test: /\.css$/, loaders: ['style', 'css?sourceMap'], include: APP_PATH }, { test: /\.(png|jpg)$/, loader: 'url?limit=40000' }, { test: /\.jsx?$/, loader: 'babel', include: APP_PATH, query: { presets: ['es2015'] } }],preLoaders: [ { test: /\.jsx?$/, include: APP_PATH, loader: 'jshint-loader' }]},jshint: { "esnext": true}};此時(shí)運(yùn)行npm start,便出現(xiàn)下面的錯(cuò)誤截圖:
webpack中jshint檢測(cè)代碼報(bào)錯(cuò)
慕仙森
2018-08-30 10:08:16