We have some css files in a folder called bar/styles that would need to be copied to the main, app/styles folder so that the build can find them there. (In reality, it's a bit more complex, as we decide on whether to pull in css files from bar or another folder).
Before switching to Embroider, the functionality was done in an in-repo add-on which had a treeForStyles hook, with a funnel.
It seemed to me like the same can be achived by creating a tree with the same funnel and passing the resulting tree as the extraPublicTrees option in Embroider:
let stylesTree = funnel('bar/styles', {
destDir: 'app/styles',
});
return require('@embroider/compat').compatBuild(app, Webpack, {
extraPublicTrees: [stylesTree],
});
When I print out stylesTree with broccoli-stew, it all seems good, the css files were copied over. However, the PostCSS processor doesn't see it:
Build Error (PostcssCompiler)
File not found: /app/styles/app.css
in any of the following include paths:
/tmp/broccoli-88165eq8hUc9Hfrr1/out-0948-funnel
, and I don't think this problem is related to PostCSS – I'm fairly certain I'd see it without the PostCSS processing.
Is extraPublicTrees not meant for this purpose? If not, what's the recommended way to achieve the merging (the pulling in of CSS files from another folder/add-on)?
Thank you!