mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
refactor: code splitting strategy
This commit is contained in:
parent
41180c57bf
commit
95baf27d58
1 changed files with 19 additions and 0 deletions
|
|
@ -24,6 +24,25 @@ export default defineConfig(({mode}) => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
build: {
|
||||||
|
rollupOptions: {
|
||||||
|
output: {
|
||||||
|
manualChunks(id, {getModuleInfo}) {
|
||||||
|
if (id.includes("d3")) {
|
||||||
|
return "d3";
|
||||||
|
}
|
||||||
|
if (id.includes("node_modules")) {
|
||||||
|
return "vendor";
|
||||||
|
}
|
||||||
|
|
||||||
|
const importersLen = getModuleInfo(id).importers.length;
|
||||||
|
if (importersLen > 1) {
|
||||||
|
return "common";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: [
|
alias: [
|
||||||
{find: "src", replacement: path.resolve(pathName, "./src")},
|
{find: "src", replacement: path.resolve(pathName, "./src")},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue