Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

CSS + SASS #871

Closed
ovidius72 opened this issue May 12, 2018 · 3 comments
Closed

CSS + SASS #871

ovidius72 opened this issue May 12, 2018 · 3 comments

Comments

@ovidius72
Copy link

ovidius72 commented May 12, 2018

I would like to use sass with sass-loader but I also need to import a css file.
The index.js file has the following imports

import './path/to/file.css'
import './path/to/file.sass'

It's a react application so in the neutrino/react configuration I have:

style: {
    moduleTest: /\.module\.sass$/,
    test: /\.sass$/,
    loaders: [{
      loader: 'sass-loader'
      userId: 'sass'
    }]

After this I'm able to import .sass files but not css ones.
How can I have the sass-loader and still be able to import css files.
Thx

@eliperelman
Copy link
Member

You should be able to follow a similar pattern as the one for LESS:

https://spectrum.chat/?t=a60e9355-9e30-4ba5-af0b-36ed8a40eda3

@ovidius72
Copy link
Author

@eliperelman Thanks for you help.
The solution was to add also css to the sass-loader, like so:

 style: {
          loaders: [
            { loader: 'sass-loader', userId: 'sass' },
          ],
          test: /\.(css|sass)$/,
          moduleTest: /\.module.(css|sass)$/
        },

edmorley added a commit that referenced this issue May 18, 2018
Since unless the default file extension regex is overridden, the
`.sass` (old style) or `.scss` (new style) Sass styles will not
be seen by `sass-loader`:
https://github.com/webpack-contrib/sass-loader#examples
https://sass-lang.com/documentation/file.SASS_REFERENCE.html

Closes #755.
Closes #803.
Refs #871.
@constgen
Copy link
Contributor

constgen commented Aug 17, 2020

Have implemented Sass and Less middlewares recently that excellently integrate with the core style-loader

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants