Using the below vite.config.js
configuration we can change the javascript production bundle name to a static value index.bundle.js
:
import { defineConfig } from "vite";
export default defineConfig({
build: {
rollupOptions: {
output: {
entryFileNames: "index.bundle.js",
assetFileNames: "index.bundle.css",
},
},
},
});
Are there any drawbacks to doing this. The reason I want to do it is that it makes it easier to set the main
property package.json
to "main": "index.bundle.js"
and this makes it easier to publish to NPM.
If the bundle gets a new name on each build, then the main
property would have to be updated to the new name every time the package is published.
Just curious if there are any drawbacks (Browser preview stale cache?) to using a fixed value?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744164921a4561260.html
评论列表(0条)