egoist / egoist/rollup-plugin-postcss

Error thrown "@use rules must be written before any other rules."

Open
#443 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
689
Forks
210
PR merge metrics
No merged PRs in 30d

Description

I am attempting to add the autoprefixer plugin, but I get a build error, "@use rules must be written before any other rules.".

Here is my rollup config:

````
module.exports = options => ({
...options,
plugins :[
scss({
failOnError: false,
processor :() => postcss({
plugins: [
autoprefixer()
],
}),
}),
...options.plugins,
],
});
````

After setting a breakpoint, it appears the offending code is here. This block combines all the stylesheets into one and does not consider that @use statements must appear in the file's header.

````
// Combine all stylesheets
let scss = ''
for (const id in styles) {
scss += styles[id] || ''
}
````

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.