How can I use Sass in Shopify-cli created app?

Solved
Highlighted
Excursionist
16 0 0

How can I load the appropriate loader to use scss in my app?

 

I tried adding the scss loader to the next.config.json :

Screen Shot 2019-11-12 at 6.18.39 PM.png

 

but then the css loader does not seem to work anymore:

console.jpg

 

Does anyone know how to add it properly?

0 Likes

Success.

Shopify Staff
Shopify Staff
25 4 4

Hi @PhilippW,

 

You've wrapped the config correctly with `next-sass`, but you still need the CSS loader:

 

module.exports = withCSS(withSass({
  webpack: config => {
    const env = { API_KEY: apiKey };
    config.plugins.push(new webpack.DefinePlugin(env));
    return config;
  }
}));
1 Like
Excursionist
16 0 0

Thank you @katiedavis! It's working perfectly for me now.

0 Likes