I'm learning webpack from scratch. I've learned how to link javascript files with require. I'm bundling and minifying my js files and i'm listening for changes with watch. I'm setting up loaders to convert my sass files to css. But when I try to setup a linting process with jshint-loader, i'm running into issues.
module: { preLoaders: [ { test: /\.js$/, // include .js files exclude: /node_modules/, // exclude any and all files in the node_modules folder loader: "jshint-loader" } ], loaders: [ { test: /\.scss$/, loader: 'style-loader!css-loader!sass-loader' }, { test: /\.js$/, loader: 'babel-loader', exclude: /node_modules$/, query: { presets: ['es2015'] } } ],
}
Here is the error
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema. - configuration.module has an unknown property 'preLoaders'. These properties are valid: object { exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, loaders?, noParse?, rules?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp? } Options affecting the normal modules (
NormalModuleFactory
).
You are apparently trying to use examples for webpack v1 with webpack v2. Straight from the changelog:
module: { - preLoaders: [ + rules: [ { test: /\.js$/, + enforce: "pre", loader: "eslint-loader" } ] }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With