-
Notifications
You must be signed in to change notification settings - Fork 12
How to enable scss in project ? #2
Comments
Hi @markopredovic, I haven't done this myself in PWA Studio yet but imagine you will need to: Install the webpack sass-loader: And update the webpack.config.js file to include something like. config.module.rules.push({
test: /\.scss$/,
loaders: [
require.resolve('style-loader'),
{
loader: require.resolve('css-loader'),
options: {
localIdentName: '[path][name]__[local]--[hash:base64:5]',
modules: true,
},
},
{
loader: require.resolve('sass-loader'),
/**
* To prevent including the theme in every file we use the prependData attribute to load the theme
*/
options: {
prependData: '@import "./src/theme.scss";',
},
},
],
}); For more info see: Once you getting it working, it would be great if you could share it in a PR. Thanks :) |
Thanks @rossmc , will do |
I ended with this configuration for now, it is not quite generic but ok, scss files with 'module' in name are scoped to component, also have global available scss styles in src root directory.
|
oh this is great. Thanks @markopredovic. At some point soon, I hope use this to update the css-modules doc with an Optionally Use SCSS section. |
@rossmc , what is a way to edit webconfig in this project setup, to enable scss ?
The text was updated successfully, but these errors were encountered: