Sass support?
See original GitHub issueMost likely related to #24, but I’m running into an error when trying to import Sass (.scss) files in react-static. I’m attempting to modify the built-in webpack config, per the docs, with the following:
webpack: webpackConfigurator => {
webpackConfigurator.merge({
module: {
rules: [
{
test: /\.scss/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
minimize: true,
importLoaders: 1
}
},
{
loader: 'sass-loader'
}
]
})
}
]
},
plugins: [
new ExtractTextPlugin({
filename: 'public/[name].css',
disable: process.env.NODE_ENV === 'development'
})
]
})
}
In App.js, I have a single line of import './style.scss'
which has some nested Sass, for testing purposes.
However, when running react-static start
, I receive the following error:
Module not found: Can't resolve 'sass-loader' in '/usr/local/lib/node_modules/react-static/dist/node_modules'
I’m looking to have a “global” Sass file for shared styling, and have the ability to import Sass files at the component level.
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (12 by maintainers)
Top Results From Across the Web
Sass: Syntactically Awesome Style Sheets
Sass is the most mature, stable, and powerful professional grade CSS ... Sass has been actively supported for about 16 years by its...
Read more >Sass Introduction - W3Schools
This is where a CSS pre-processor can help. Sass lets you use features that do not exist in CSS, like variables, nested rules,...
Read more >Screening, Assessment and Support Services | HFS - Illinois.gov
If you have questions or comments regarding the Screening, Assessment and Support Services (SASS) program, please Contact Us. If you are in need...
Read more >Sass (stylesheet language) - Wikipedia
For the software distribution scheme known as "SaaS", see Software as a service. Sass (short for syntactically awesome style sheets) is a preprocessor...
Read more >CSS, SCSS, and Less support in Visual Studio Code
Visual Studio Code has built-in support for editing style sheets in CSS .css , SCSS .scss and Less .less . In addition, you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
All of this will be solved very soon. Hoping by the end of today haha. I’m working on moving the node builds to a webpack environment. This way you can rely on webpack resolution and loaders doing their job across the entire build process.
One of the changes that this will bring is the ability to specify which webpack config you are altering by using the
stage
variable instead of thedev
variable in the webpack callback. This way you can get really fine grained.Stay tuned. Really sorry about this. But hey, that’s open source right 😉
Version 2.0.0 is now released with better support for webpack configs. Let’s get a sass plugin ready so we can close this issue 😃