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

Parcel v2 Optimizer Plugin #78

Open
s0kil opened this issue Jan 30, 2020 · 3 comments
Open

Parcel v2 Optimizer Plugin #78

s0kil opened this issue Jan 30, 2020 · 3 comments

Comments

@s0kil
Copy link

s0kil commented Jan 30, 2020

I was wondering if subfont could have an optimer plugin for Parcel v2?

@s0kil
Copy link
Author

s0kil commented Jan 31, 2020

Instead of having to run a Parcel build step, and then subfont, it will be done in one go.

@papandreou
Copy link
Collaborator

I'm not super familiar with the api that Parcel exposes to plugins, but it's probably possible. Might require a heavy restructuring of subfont itself to make it less dependent on assetgraph, which I'm not sure that we want.

@s0kil s0kil closed this as completed Feb 2, 2020
@Munter
Copy link
Owner

Munter commented Feb 13, 2020

A bundler for parcel would be more correct in terms of its lifecycle.

It would be completely possible to build this, but it would probably not be a whole lot faster unless we accidentally have the same AST abstraction in Parcel and Assetgraph so we could skip the heavy parsing work. I can see they use postcss as well, but the dom representation differs.

I imagine you could build such a plugin, iterate through all the html, css and font assets on the parcel graph and manually feed them into assetgraph to get our representation, then run something like https://github.com/parcel-bundler/parcel#bundler on it and load all the updated and added assets back into the parcel graph

I also see this as seperate project, that just happens to use subfont. Like https://github.com/Munter/netlify-plugin-subfont

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants