thgh / rollup-plugin-scss

Rollup and compile multiple .scss, .sass and .css imports
MIT License
135 stars 46 forks source link

Generating a JS file that I do not want #35

Closed jobelenus closed 5 years ago

jobelenus commented 5 years ago

The README is not up to date with newer versions of rollup

I have one global.scss file. The plugin creates a global.css file like I expect but it also creates a global file with no extension and just the use strict; javascript on the only line. If I just want to crunch scss —> css why am I getting a js file as well?

Here is the output of rollup:

bundles public/scss/global.scss → public/global...
(!) Generated an empty bundle
public/global.css 995 B
created public/global in 5ms

Here is the rollup.config.js for this section:

{
    input: 'public/scss/global.scss',
    output: {
    file: 'public/global',
    format: 'cjs',
  },
    plugins: [
        scss()
    ]
};

This is not the only plugin in the rollup, I am using Svelte as well.

thgh commented 5 years ago

Rollup is an ES modules bundler and will always output JavaScript. Don't use a scss file as input. Import it from your svelte app.

Or check out the node-sass package which does exactly what you want.