thgh / rollup-plugin-scss

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

Use Rollup emitFile instead of fs.writeFile #98

Closed nielsvanvelzen closed 1 year ago

nielsvanvelzen commented 1 year ago

This PR is the same as #71 but recreated for the current v3 branch.

nielsvanvelzen commented 1 year ago

@thgh any chance you can look at this PR?

thgh commented 1 year ago

OK, will merge this

thgh commented 1 year ago

The tests didn't pass so I refactored the naming and aligned it with rollup-plugin-css-only. The options now also align with the Rollup emitFile API: name and fileName. I'm not sure what they do exactly, but I tried to describe it in comments, let me know if that is inaccurate!

Released v4.0.0 because not sure if it's a breaking change

nielsvanvelzen commented 1 year ago

I didn't set the output variable before so for me the change was breaking. I had to add the fileName property and set it to projectname.css to get it in the same location as before. Everything is working now.

Thanks for the merge!

thgh commented 1 year ago

Good to hear it's working 🎉

Slightly unfortunate that Rollup defaults to generating unpredictable filenames. On the other, I hope it's a good longterm decision that this plugin requires explicit naming for predictable filenames.