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-beta23+ breaks webpack.config.options #289

Closed
gpazo opened this issue Oct 13, 2016 · 9 comments
Closed

webpack 2.1.0-beta23+ breaks webpack.config.options #289

gpazo opened this issue Oct 13, 2016 · 9 comments

Comments

@gpazo
Copy link

gpazo commented Oct 13, 2016

Original webpack issue: webpack/webpack#3018

Fix documentation to change:

module.exports = {
  ...
  module: {
    loaders: [
      {
        test: /\.scss$/,
        loaders: ["style", "css", "sass"]
      }
    ]
  },
  sassLoader: {
    includePaths: [path.resolve(__dirname, "./some-folder")]
  }
};

to:

module.exports = {
  ...
  module: {
    plugins: [
      new webpack.LoaderOptionsPlugin({
        options: {
          sassLoader: {
             includePaths: [path.resolve(__dirname, "./some-folder")]
        }
     })
    ],
    loaders: [
      {
        test: /\.scss$/,
        loaders: ["style", "css", "sass"]
      }
    ]
  }
};

@tleunen
Copy link

tleunen commented Oct 14, 2016

The sass loader should be updated to the new way of passing options instead of using the LoaderOptionsPlugin.

@luchillo17
Copy link

@tleunen So in the mean time we need to stick with webpack beta.22?

@tleunen
Copy link

tleunen commented Oct 24, 2016

No not really.. there's a fix explained here for the context: webpack/webpack#3018 (comment)

@luchillo17
Copy link

Yeah i saw that, however in my case it didn't work.

@leaves4j
Copy link

leaves4j commented Oct 26, 2016

@gpazo TypeError: webpack.LoaderOptionsPlugin is not a constructor
I got this error in webpack@2.1.0-beta.25

@cmckni3
Copy link

cmckni3 commented Nov 1, 2016

I switched to using the module.rules use syntax.

{
  test: /\.scss$/,
  use: [
    'style-loader',
    'css-loader',
    {
      loader: 'sass-loader',
      query: {
        includePaths: [path.resolve(__dirname, "./some-folder")]
      }
    }
  ]
}

@alexander-akait
Copy link
Member

@gpazo @tleunen @luchillo17 @leaves4j please update to latest webpack version 👍

Closing this out, please feel free to reopen if this doesn't resolve your issue. Thanks!

@pretentiousgit
Copy link

This is still a bug in webpack-cli with webpack 2.5.1, fresh install of everything.

@luchillo17
Copy link

@pretentiousgit Seems only with cli, i don't get this issue any more with latest webpack.

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

7 participants