Is there any way of using Rollup and rollup-plugin-postcss and rollup-plugin-scss so it treats css modules separately and sass separately?

689 views Asked by At

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'],
    }),
0

There are 0 answers