Viewers icon indicating copy to clipboard operation
Viewers copied to clipboard

SCSS Error When Compiling Monorepo version

Open mtm12 opened this issue 7 years ago • 2 comments

In the previous version of the viewer, I use SCSS to format a modal component. In the monorepo version, with node-sass installed, I get an error saying there is no loader for scss file types. I tried installing node-sass at the root as well as in \platform. Has anyone else seen this problem?

mtm12 avatar Aug 22 '19 16:08 mtm12

@mtm12, modify ROOT/.webpack/webpack.common.js to use the WebPack SASS Loader. You'll need to add it as a dependency.

I'd be willing to merge the change to master, as I'd like to eventually phase out our stylus usage. The loader for it is "meh", and SASS/SCSS has a larger following and support.

dannyrb avatar Aug 22 '19 16:08 dannyrb

@dannyrb Thank you. To add SCSS support:

  1. from root: yarn add sass-loader node-sass webpack --save-dev -W
  2. add the following to module:rules in platform\viewer.webpack\all.dev.js { test: /.s[ac]ss$/i, use: [ // Creates style nodes from JS strings 'style-loader', // Translates CSS into CommonJS 'css-loader', // Compiles Sass to CSS 'sass-loader', ], },

mtm12 avatar Aug 22 '19 17:08 mtm12