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

Using in webpack to load sass in node_modules #346

Closed
golinmarq opened this issue Jan 12, 2017 · 3 comments
Closed

Using in webpack to load sass in node_modules #346

golinmarq opened this issue Jan 12, 2017 · 3 comments

Comments

@golinmarq
Copy link

In documentation says:

Thus you can import your Sass modules from node_modules. Just prepend them with a ~ to tell webpack that this is not a relative import

So, I'm using React Toolbox for my components and they recommend to add this loader. I added to my webpack.development.config but when I run this, the styles are not loaded.

My web pack.development.config code is:

...
loaders: [
      {
        test: /\.global\.css$/,
        loaders: [
          'style-loader',
          'css-loader?sourceMap'
        ]
      },

      {
        test: /^((?!\.global).)*\.css$/,
        loaders: [
          'style-loader',
          'css-loader?modules&sourceMap&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]'
        ]
      },

      {
        test: /\.scss$/,
        loaders: ["style-loader", "css-loader", "sass-loader"]
      }, 
...
@modosc
Copy link

modosc commented Jan 31, 2017

i'm seeing this too with "node-sass": "^4.4.0" (and 4.5.0 as of today, just tested) - when i switch back to node-sass@^3.13.1 it works again. i've also tried setting includeDirectories in my sass-loader query per comments here but it didn't help.

@jhnns
Copy link
Member

jhnns commented Feb 13, 2017

Sorry, there is not enough information to reproduce this. Please provide a minimal test repository that demonstrates the problem so I can check that out. Try to remove as much stuff as possible since it helps tracking down the problem.

@alexander-akait
Copy link
Member

@modosc for import from modules please read https://github.com/webpack-contrib/sass-loader#imports

More 90 days inactive (no provided test repo 😞 ). Closing this out, please feel free to reopen if this doesn't resolve your issue. Thanks!

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

4 participants