thgh / rollup-plugin-scss

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

Modify output option to generate missing parent folders in path #2

Closed soulchainer closed 7 years ago

soulchainer commented 7 years ago

output option only accept an existent path to save the CSS bundle. With this edit, we can specify a partial existent path. The missing folders will be created when needed.

So, now I can:

scss({
      outputStyle: 'compressed',
      output: 'build/styles/bundle.css',
    }),

in rollup.config.js and it will generate the bundle in the specified folder, inside my project. Even if styles folder or even build folder doesn't still exist. Without this change, we can only put the file in an existing folder, so we need to create it... manually. That's far from ideal, I think.

Edit: I created another commit for deleting the semicolons. I prefer the semicolons, so I didn't realize previously you wasn't using them.