elycruz / rollup-plugin-sass

Rollup .sass files.
MIT License
91 stars 33 forks source link

Rollup replaces output file #130

Closed ramanarupa closed 2 weeks ago

ramanarupa commented 3 months ago

when I'm trying to use such configuration, rollup replaces sass output file by file which generated by rollup itself

import sass from 'rollup-plugin-sass';

export default [
  {
    input: 'App/sass/index.scss',
    output: {
      file: 'myfile.css',
    },
    plugins: [
      sass({
        output: 'myfile.css,
        options: {
          outputStyle: 'compressed',
        },
      }),
    ],
  }
];

how to resolve this issue ?

elycruz commented 3 months ago

Currently the plugin doesn't support *.css files (the supported extensions are currently hard-coded in the plugin).

I've opened a new ticket for adding the ability to set the extensions the plugin recognizes at runtime (ticket no. below).

Please subscribe to #131 - The work will be performed via there.

elycruz commented 2 months ago

@ramanarupa Question, is it that the files are replaced with empty files, and/or are the files replaced but with "uncompressed" content?

elycruz commented 2 weeks ago

After looking at your code more closely it is clear that rollup overwrites your file because you have it listed as it's output file. Additionally, we're not going to support pure .css files, as part of our plugin, due to 'dart-sass' not supporting .css imports (by default). If you need pure css files support I recommended using 'postcss' (or one of the rollup compatible ones), in your build pipeline.