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

Unable to find sass-loader in next.config.js #11048

Closed
tankpower1 opened this issue Mar 13, 2020 · 4 comments · Fixed by #11063
Closed

Unable to find sass-loader in next.config.js #11048

tankpower1 opened this issue Mar 13, 2020 · 4 comments · Fixed by #11063

Comments

@tankpower1
Copy link

Bug report

Describe the bug

A clear and concise description of what the bug is.

Hi,
for my project i needed to pass a variable from webpack to scss which i managed to do in v9.2.2 but since updating to 9.3.0 it doesn't seem to work and i can't seem to locate the sass-loader.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to 'next.config.js'
  2. Add this code:
webpack(config) {

        let isDev = ENVIRONMENT !== 'production';

        config.module.rules.forEach(rule => {

            if (rule.test && rule.test.toString().includes('.scss')) {

                rule.use.forEach(el => {

                    if (el.loader && el.loader === 'sass-loader') {

                        el.options.data = `$isDev: ${isDev};`;
                    }
                })

            }
        });

        return config;
    }

Expected behavior

A clear and concise description of what you expected to happen.

It should work.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: macOS
  • Version of Next.js: 9.3.0

Additional context

Add any other context about the problem here.

@timneutkens
Copy link
Member

See #11063

@tankpower1
Copy link
Author

So in v9.3.1-canary.4 sassOptions is supported and i can now pass custom variables to its options?

@timneutkens
Copy link
Member

No, it hasn't been merged, hence why the PR is open.

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants