Skip to content

Refactor: CssWriter #120

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

Merged
merged 2 commits into from
Aug 3, 2020
Merged

Refactor: CssWriter #120

merged 2 commits into from
Aug 3, 2020

Conversation

lukeed
Copy link
Member

@lukeed lukeed commented Aug 3, 2020

Initially just added types from #72; but then decided to extract an emit function to minimize potential misuse within the css function. AKA, by exposing the entire PluginContext within the css function, one could easily fumble around and break their Rollup build. By just exposing this.emit, we still offer flexibility of emitting additional assets within the css() callback, if/when needed.

@lukeed lukeed requested review from benmccann and pngwn August 3, 2020 17:47
@benmccann
Copy link
Member

the other option here that might be easier is to just make some of the fields like bundle private. I don't think we really need to expose bundle or emit actually

@lukeed
Copy link
Member Author

lukeed commented Aug 3, 2020

Having this.emit could be nice since it allows the dev to have a final window to emit extra assets into the bundle; especially since we expose filename too now.

@pngwn
Copy link
Member

pngwn commented Aug 3, 2020

Yep, this makes sense. Looks good to go. 👍

@benmccann benmccann merged commit 5d22b2c into master Aug 3, 2020
@lukeed lukeed deleted the refactor/css-writer branch August 3, 2020 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants