Browse Source

feat: 静态资源分类打包

i18n
xiaoxian521 2 years ago
parent
commit
b811256830
  1. 13
      vite.config.ts

13
vite.config.ts

@ -69,7 +69,18 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
build: {
sourcemap: false,
// 消除打包大小超过500kb警告
chunkSizeWarningLimit: 4000
chunkSizeWarningLimit: 4000,
rollupOptions: {
input: {
index: pathResolve("index.html")
},
// 静态资源分类打包
output: {
chunkFileNames: "static/js/[name]-[hash].js",
entryFileNames: "static/js/[name]-[hash].js",
assetFileNames: "static/[ext]/[name]-[hash].[ext]"
}
}
},
define: {
__INTLIFY_PROD_DEVTOOLS__: false,

Loading…
Cancel
Save