Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Serve optimized web bundles for better performance #279

Open
marcofranssen opened this issue Apr 9, 2020 · 2 comments
Open

Serve optimized web bundles for better performance #279

marcofranssen opened this issue Apr 9, 2020 · 2 comments
Labels
discussion Any questions about this theme.

Comments

@marcofranssen
Copy link
Contributor

It would be great if this theme could serve optimized web bundles for better page performance.

I have also filed an issue here hexojs/hexo#4221

Any thoughts on how this theme could slowly move in that direction? I'm happy to work on this, but would require some guidance on where to start to make this possible.

In order to comply with modern fast loading webpages it should be possible for Hexo themes to use tools like https://github.com/webpack so we can serve optimized bundles of javascript and css to the browser.

I'm really looking forward to either a piece of documentation on how to achieve that or something like a hook which we can attach to the generate process.

E.g. check the lighthouse scoring of my blog.

@ppoffice
Copy link
Owner

ppoffice commented Apr 9, 2020

I think this should be implemented as a Hexo plugin instead of a theme feature.

@ppoffice ppoffice added the discussion Any questions about this theme. label Apr 9, 2020
@marcofranssen
Copy link
Contributor Author

marcofranssen commented Apr 11, 2020

Yes but large parts should also be part of the theme. E.g. Which JS framework is used in the theme. E.g. a React application using webpack bundling is different then bundling old school js.

I did see the stylus parts in this theme do have some variables, I wonder how that part is done in this theme.

Maybe we could use a similar build approach for the javascript to prepack the JS just like the stylus parts to get a bundle specific to the config, so only that js is in there.

I do believe that this could make this theme a real killer-theme.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
discussion Any questions about this theme.
Projects
None yet
Development

No branches or pull requests

2 participants