javascript - Are there any drawbacks to changing the vite production bundle name to a static value like index.bundle.js? - Stack

Using the below vite.config.js configuration we can change the javascript production bundle name to a s

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条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信