summaryrefslogtreecommitdiffhomepage
path: root/frontend/config/chunks.ts
blob: c5c5f7fba9d4b3eb692cb3f0e9e3268b583544ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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;