3

We are using rollup to build our project and our requirement is a single .css file generated from compiling the .scss files. Separately in some components we want to use css modules with the styles being imported.

On configuring rollup with rollup-plugin-postcss, it correctly mangles the css modules, and exposes it to the javascript, but it also ends up mangling the .scss files which we didn't want happening. Here we didn't want to mangle the .scss files and wanted their class names to remain unchanged as we're directly referencing them and not as modules.

Our configuration was:

    postcss({
      extract: false,
      modules: true,
      use: ['sass'],
    }),
Mickey Puri
  • 835
  • 9
  • 18

0 Answers0