hexo-theme-hueman icon indicating copy to clipboard operation
hexo-theme-hueman copied to clipboard

Serve optimized web bundles for better performance

Open marcofranssen opened this issue 4 years ago • 2 comments

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

I have also filed an issue here https://github.com/hexojs/hexo/issues/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.

marcofranssen avatar Apr 09 '20 09:04 marcofranssen

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

ppoffice avatar Apr 09 '20 17:04 ppoffice

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.

marcofranssen avatar Apr 11 '20 09:04 marcofranssen