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

Add support for SCSS modules (Next.js 9.2) #66

Closed
vimota opened this issue Jan 31, 2020 · 5 comments
Closed

Add support for SCSS modules (Next.js 9.2) #66

vimota opened this issue Jan 31, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@vimota
Copy link

vimota commented Jan 31, 2020

Importing SCSS modules/files from a node_module (we have separate workspaces imported as modules) fails. NextJS has added built-in support for SCSS, like they have for CSS, but it doesn't allow for node_module imports: https://github.com/zeit/next.js/pull/10133/files#diff-0df73c8e15d5a4ab2409907c614af8ebR143 (an example of it's usage: vercel/next.js#10321).

If I understand correctly, it should be possible to add support for it in this library like you did for CSS (1cb6190) correct?

I've tried something like:

module.exports = withTM({
  experimental: {
    scss: true,
  },
  webpack: withWebpack,
});

but it fails with :

Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> @charset "utf-8";
| @import './vars.scss';
@martpie
Copy link
Owner

martpie commented Jan 31, 2020

I did not know SCSS was supported by Next.js, I will have a look and add support for it!

@martpie martpie added the enhancement New feature or request label Jan 31, 2020
@vimota
Copy link
Author

vimota commented Feb 1, 2020

Ah, that's awesome thank you!

I'll also try fixing it in the meantime but not sure how far I'll get.

@martpie
Copy link
Owner

martpie commented Feb 3, 2020

May I ask how urgent is this? I have some things on my plate right now, and this is still an experimental feature, it means the plugin could stop working at any canary/stable release until it is not experimental anymore.

@vimota
Copy link
Author

vimota commented Feb 3, 2020 via email

@martpie
Copy link
Owner

martpie commented Mar 10, 2020

Done in 3.1.0

@martpie martpie closed this as completed Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants