Skip to content

Automatic Updating of the main property of package.json #19731

Answered by hi-ogawa
fireflysemantics asked this question in Q&A
Discussion options

You must be logged in to vote

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.
(from https://stackoverflow.com/questions/79536305/hooking-into-providing-a-callback-for-vite-production-builds)

This sounds like too niche deployment scenario, so I don't think Vite would support such mechanism builtin. That said, you should be able to achieve the same by writing own script before release to update package.json manually maybe by looking up https://vite.dev/config/build-options.html#build-manifest. Please provide an minimal example project to show your current setup if you ne…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by fireflysemantics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants
Converted from issue

This discussion was converted from issue #19725 on March 27, 2025 00:38.