Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webpack 2.1.0-beta.25 not compatible with example #36

Closed
jippi opened this issue Oct 16, 2016 · 4 comments
Closed

webpack 2.1.0-beta.25 not compatible with example #36

jippi opened this issue Oct 16, 2016 · 4 comments

Comments

@jippi
Copy link

jippi commented Oct 16, 2016

Webpack 2.1.x no longer allow a

{
  sassLoader: {
    // Apply the JSON importer via sass-loader's options.
    importer: jsonImporter
  }
}

key in the root

it yields this error

WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration has an unknown property 'sassLoader'. These properties are valid:
   object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry, externals?, loader?, module?, name?, node?, output?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
   For typos: please correct them.
   For loader options: webpack 2 no longer allows custom properties in configuration.
     Loaders should be updated to allow passing options via loader options in module.rules.
     Until loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader:
     plugins: {
       new webpack.LoaderOptionsPlugin({
         // test: /\.xxx$/, // may apply this only for some modules
         options: {
           sassLoader: ...
         }
       })
     }
@Cap32
Copy link
Contributor

Cap32 commented Oct 19, 2016

Same here ☹️

@pmowrer
Copy link
Owner

pmowrer commented Oct 20, 2016

Probably related to:
webpack-contrib/sass-loader#289
webpack/webpack#3018

Haven't moved to Webpack2 yet so I can't verify. If anyone gets it working, please create a PR to update the documentation.

Cap32 added a commit to Cap32/node-sass-json-importer that referenced this issue Oct 21, 2016
@Cap32
Copy link
Contributor

Cap32 commented Oct 21, 2016

This works for me:

plugins: [
  // ...
  new webpack.LoaderOptionsPlugin({
    options: {
      sassLoader: {
        importer: jsonImporter,
      },
      context: __dirname,
    },
  }),
 // ...
],

And I have created a PR to update the documentation. #37

@pmowrer
Copy link
Owner

pmowrer commented Oct 21, 2016

#37

@pmowrer pmowrer closed this as completed Oct 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants