add sass to my project

Solved
Highlighted
New Member
5 0 0

Hello, 

this is my config 

const { parsed: localEnv } = require("dotenv").config();
const withSass = require("@zeit/next-sass");
const withCSS = require("@zeit/next-css");
const withTypescript = require("@zeit/next-typescript");

const webpack = require("webpack");
const apiKey = JSON.stringify(process.env.SHOPIFY_API_KEY);

module.exports = withTypescript(
  withCSS(
    withSass({
      webpack: (config) => {
        const env = { API_KEY: apiKey };
        config.plugins.push(new webpack.DefinePlugin(env));
        config.module.rules.push({
          test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
          use: {
            loader: "url-loader",
            options: {
              limit: 100000,
            },
          },
        });
        return config;
      },
      env: {
        env: "dev",
      },
    })
  )
);

 

but I got this error when trying to run the server 

Cannot find module 'node-sass'

 

what do I need to do? 

0 Likes
Highlighted
Shopify Partner
47 9 17

This is an accepted solution.

Seems like you are missing this node-sass package.

1 Like
Highlighted
New Member
5 0 0

Thank but didn't understand why there is no mention for this is the official docs.

0 Likes