I am trying to switch from Mix to Bud and I (or rather the frontend dev on the project) want to use the native @import for CSS instead of having @import result in the build process merging the files.
For example
File app.css
@import url(dev-test-partials/dev-test-partial-1.css);
.app {
background: blue;
}
File dev-test-partials/dev-test-partial-1.css
.partial_1 {
background: green;
}
renders one file with both rules (.app and .partial_1) in it. I want the resulting file to look exactly like app.css (but minified and all other stuff that Bud does, except merging).
I have tried everything I can find in the Bud documentation but I always end up with one CSS-file with all @imports merged in to the file.
I have tried the following in bud.config.js
app.postcss.unsetPlugin('import')
Based on @roots/bud-postcss | bud.js
app.postcss.unsetPlugin('postcss-import');
The same as above but trying another key. After running yarn bud build
now, I get:
BudError
â Plugin import does not exist
Which leads me to believe that I am on to something but I am guessing that Bud relies on postcss-import actually being available. So I added:
app.postcss.use(['postcss-nested', 'env']);
Based on https://bud.js.org/extensions/bud-postcss#adding-a-plugin
This leads to yarn bud build
completing successfully but with the undesired outcome as described above.
So I removed all the lined mentioned above and tried
bud.postcss.setPostCssOptions({
plugins: [`postcss-nested`, `postcss-preset-env`],
})
Based on https://bud.js.org/extensions/bud-postcss#overriding-postcss-options-directly
But still no success. Is there a way to achieve what I want?
I am running v6.20.0 of @roots/bud and @roots/sage.