Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow plugin exports via "processing" lifecycle hook #404

merged 3 commits into from Feb 21, 2018


Copy link

@tivac tivac commented Feb 21, 2018

Based on a request from @AndrewLeedham in #401, this new lifecycle hook allows for modifying the exports of a CSS file by pushing a specifically crafted message onto the messages array. Details are in the new document which also conveniently exists now to better document lifecycle hooks and what they're good for.

Planning on shipping this for 8.1.0 unless someone really hates the name and lets me know pretty quickly, it's a pretty harmless change that could allow some interesting new approaches.

tivac added 3 commits Feb 18, 2018
`after` should probably just become what `during` is, it's a breaking change but not terribly different in practice.

Plugins run as part of the `during` phase can add messages with a plugin name starting with `modular-css-export` and an `exports` key that will be merged into the file's exports.

Fixes #401 in a roundabout way by making it possible w/o a change to core.

This also makes the output module support non-array values because having to know that is just an awkward implementation detail that makes no sense for anyone but me.
It's at least a little better
@tivac tivac self-assigned this Feb 21, 2018
@tivac tivac merged commit 72a89de into master Feb 21, 2018
2 checks passed
@tivac tivac deleted the allow-plugin-exports branch Feb 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant