question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Most 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:closed
  • Created 6 years ago
  • Comments:16 (12 by maintainers)

github_iconTop GitHub Comments

4reactions
tannerlinsleycommented, Oct 19, 2017

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 the dev 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 😉

2reactions
tannerlinsleycommented, Oct 20, 2017

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 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found