feat(metro-config): add postcss (#22032)# Why - Required for modifying CSS and supporting Tailwind on web (but also universally). - Eventually we'll want to add some postcss transforms by defa
feat(metro-config): add postcss (#22032)# Why - Required for modifying CSS and supporting Tailwind on web (but also universally). - Eventually we'll want to add some postcss transforms by default (standard in the web community). <!-- Please describe the motivation for this PR, and link to relevant GitHub issues, forums posts, or feature requests. --> # How - Write a `postcss` parser which loads the user config. - `postcss.config.js` and `postcss.config.json` are the only supported config files. https://github.com/webpack-contrib/postcss-loader/blob/ef332db57381ed1d8aaa4a9a20eec0e0b21fdb7c/src/utils.js#L64-L114 - Process input CSS with postcss config and pass output to standard CSS loading process. - TBD: More advanced Metro cache invalidation. - We currently have a basic hashing system which auto invalidates the transformer when the config file and browserslist options change. <!-- How did you build this feature or fix this bug and why? --> # Test Plan - Added minor tests for certain parts of the flow but nothing e2e. <!-- Please describe how you tested this change and how a reviewer could reproduce your test, especially if this PR does not include automated tests! If possible, please also provide terminal output and/or screenshots demonstrating your test/reproduction. --> # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `expo prebuild` & EAS Build (eg: updated a module plugin). --------- Co-authored-by: Expo Bot <[email protected]>
show more ...