hope can allow use sass replace node-sass
How about this:
withSass({
sassLoaderOptions: {
implementation: require('sass')
}
})
why not let it auto handle, let user just need choose install node-sass or sass
This doesn't work for me
// next.config.js
const withSass = require('@zeit/next-sass');
const sass = require('sass');
module.exports = withSass({
cssModules: true,
sassLoaderOptions: {
implementation: sass,
},
});
```shell
Error: Cannot find module 'node-sass'
```json
"@zeit/next-sass": "1.0.1",
"sass": "1.25.0"
@in-in before they take this pr, or maybe never
u can try use this code in package.json and use yarn
"dependencies": {
"node-sass": "npm:sass"
}
@in-in I test the config locally, it works.
By the way, does your project work with node-sass?
Yes _Sass_ files compiles without any problems with node-sass ("4.13.1")
@tingtingtinghuang Could you post your package.json and next.config?
I'm using
module.exports =
withBundleAnalyzer(
withSass({
webpack(config, ) {
config.node = {
fs: 'empty'
};
return config;
},
sassLoaderOptions: {
implementation: require('sass')
}
}));
"@zeit/next-sass": "^1.0.1",
"sass": "^1.25.0"
and also get the error: Error: Cannot find module 'node-sass'
I import my .scss in a component, not the _app.
@chrisandrewca
"sass": "1.14.1",
"sass-loader": "7.1.0"
Remember to add sass-loader in dependencies.
Hi, thanks for creating an issue. We currently recommend using nextjs.org/docs/basic-features/built-in-css-support as the plugins have been deprecated in favor of the built-in support.
Most helpful comment
@chrisandrewca
Remember to add sass-loader in dependencies.