ember-cli-postcss filters not running under embroider
See original GitHub issueCross posting this embroider compatibility issue from the ember-cli-postcss repo: https://github.com/jeffjewiss/ember-cli-postcss/issues/714
tl;dr: the addon uses the postprocessTree
hook to run a postcss “filter” operation, this hook seems to no longer work under embroider.
From https://jeffjewiss.github.io/ember-cli-postcss/docs:
if you would like to run Postcss after another processor or on all of your styles, including files added by addons or through vendor, then use filter.
Is there a recommended path forward for addons like this which want to do work at a particular stage of the build pipeline?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:11 (6 by maintainers)
Top Results From Across the Web
ember-cli-postcss - Bountysource
I'm running into an issue where ember-cli-postcss filters aren't being run during app/addon builds. From playing around with repo config and ember-cli-postcss ......
Read more >Postcss-import problem with TailwindCSS v1.0 - Ember.JS
I suspect this is a problem with postcss-import not being able to detect the base.css and the rest of the css files in...
Read more >ember-cli-postcss | Yarn - Package Manager
Note: it's possible to use both compile and filter. ... Filter. This step will run at the end of the build process on...
Read more >how to filter out files during when ember-cli is building my app ...
I am trying to reduce monaco-editor dependency size. generally, if you're using embroider, if you don't import it, it won't be a part...
Read more >ember-css-modules - npm Package Health Analysis | Snyk
Further analysis of the maintenance status of ember-css-modules based on released npm versions cadence, the repository activity, and other data points ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I will add one warning about using sass directly with webpack.
Sass is a bundler in its own right, and not just a transpiler. Some obvious things you might decide to do, like having each of your component javascript files import a corresponding sass file, give disastrously bad output (like, megabytes and megabytes of duplicated styles).
Sass has a solution for this, which is “sass modules” (which means using
@use
instead of@import
), so if you and your sass-providing dependencies have switched to that, you can do fine-grained inclusion of sass. But most codebases I’ve seen still use the older style.Using that style, you should limit yourself to having a single place in the app do an import of a single top-level sass file:
and the app.scss should internally
@import
or@use
everything else that’s needed.We’ve had some success getting the postcss “filter” operation to run as part of the existing broccoli pipeline in our embroider app, short-circuiting the non-existent
postprocessTree
hook.Removing our existing
ember-cli-postcss
config:and replacing it with a direct invocation of
broccoli-postcss
:Extra context
In this app I’m testing, we only use PostCSS for replacing
@tailwind
at-rules and minification (withember-cli-sass
handling the rest of our app styles) so this may be a simplified use case.