Webpack uses eslint on compile

This commit is contained in:
Alasdair Smith 2018-02-22 19:27:25 +00:00
parent 24ddb46b95
commit 61a60c04a6

View file

@ -31,10 +31,16 @@ module.exports = {
// Define how file types are handled by webpack
module: {
rules: [{
// Pass application JS files through babel-loader, compiling to ES5
test: /\.js$/, // Only compile .js files
// Ensure eslint is run before compilation with babel
enforce: 'pre',
test: /\.js$/,
// Only compile application files (dependencies are in ES5 already)
exclude: /node_modules/,
loader: 'eslint-loader'
}, {
// Pass application JS files through babel-loader, compiling to ES5
test: /\.js$/,
// Only compile application files (dependencies are in ES5 already)
// include: [path.join(__dirname, './public/frontend')],
exclude: /node_modules/,
use: [{
loader: 'babel-loader',