最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Hooking intoproviding a callback for vite production builds? - Stack Overflow

programmeradmin3浏览0评论

When vite builds bundles for production it postfixes a random identifier to the end of the bundle name.

When we publish bundles to npm that use the main property package.json to indicate the bundle file ( So that the UNPKG CDN can be used) we have to update this property each time we want to publish.

Does vite have a way to hook into the build with a callback function that that can be run to update the main property with the new bundle file name?

It's possible to just make the bundle name fixed, but that has some drawbacks as discussed here.

发布评论

评论列表(0)

  1. 暂无评论