affeto
affeto

Reputation: 351

configuration error: has an unknown property 'loaders'

I am installing marionette using webpack and NPM according to marionette guide. I modify the webpack.config.js as below:

var webpack = require('webpack');

module.exports = {
entry: './app/driver.js',
module: {
loaders: [
  {
    test: /\.html$/,
    loader: 'underscore-template-loader'
  }
 ]
 },
 output: {
 path: __dirname + '/static/js',
 filename: 'bundle.js'
 },
 plugins: [
 new webpack.ProvidePlugin({
   _: 'underscore'
 })
 ],
resolve: {
 modules: [__dirname + '/node_modules', __dirname + '/app']
 },
 resolveLoader: {
 modules: [__dirname + '/node_modules']
 }
};

however when build the application, I have 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 'loaders'. These properties are valid: object { exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, noParse?, rules?, defaultRules?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp?, strictExportPresence?, strictThisContextOnImports? } -> Options affecting the normal modules (NormalModuleFactory).

Could you please help solving this error?

Upvotes: 3

Views: 3757

Answers (1)

HRK44
HRK44

Reputation: 2742

.loaders is deprecated : check out the webpack documentation here

This option is deprecated in favor of Rule.use.

Upvotes: 3

Related Questions