You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
447 B
30 lines
447 B
3 years ago
|
import { dependencies } from "../package.json";
|
||
|
|
||
|
const vendors = [
|
||
|
"react",
|
||
|
"react-router-dom",
|
||
|
"react-dom",
|
||
|
"react-query",
|
||
|
"axios",
|
||
|
"socket.io-client",
|
||
|
];
|
||
|
|
||
|
function renderChunks() {
|
||
|
const chunks: Record<string, string[]> = {};
|
||
|
|
||
|
for (const key in dependencies) {
|
||
|
if (!vendors.includes(key)) {
|
||
|
chunks[key] = [key];
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return chunks;
|
||
|
}
|
||
|
|
||
|
const chunks = {
|
||
|
vendors,
|
||
|
...renderChunks(),
|
||
|
};
|
||
|
|
||
|
export default chunks;
|