next-theme / hexo-theme-next

🎉 Elegant and powerful theme for Hexo.
https://theme-next.js.org
Other
2.42k stars 428 forks source link

add minified js files to the npm package #524

Open njzjz opened 2 years ago

njzjz commented 2 years ago

Please follow this Issue template to provide relevant information, such as source code repository, website URL and screenshots, which will help us investigate. 请按照此 Issue 模版提供相关信息,例如源码仓库、网站链接和屏幕截图,这将有助于我们进行调查。

Issue Checklist


Expected behavior

Add minified js files to the npm package, so we can use the minified files from unpkg. Currently, only jsdelivr and cdnjs (and their mirrors) supports minified files.

Maybe we can execute webpack before npm publish? It should be devDependencies.

sghuang19 commented 1 month ago

The only valid use case I can think of is speeding up building in CI env? But that doesn't make sense either, since dependencies are likely to be cached.

I'm closing this as not planned for now, but feel free to add your thoughts to it or reopen.

njzjz commented 1 month ago

The only valid use case I can think of is speeding up building in CI env?

This is useful when vendors.internal is set to unpkg. The JS files will not built during the CI env, but are directly fetched from the unpkg CDN.

https://github.com/next-theme/hexo-theme-next/blob/0708dc7e18cc06a80204c0d173799dabcc45a084/_config.yml#L907-L911