From 0d9db1b6f2f996fde36d24907a4f7d8b6552f21f Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 16 Mar 2021 17:00:02 +0100 Subject: [PATCH] web: use chunking for vendor and api Signed-off-by: Jens Langhammer --- web/rollup.config.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/web/rollup.config.js b/web/rollup.config.js index c818414bc..3c7cdc794 100644 --- a/web/rollup.config.js +++ b/web/rollup.config.js @@ -18,6 +18,15 @@ const resources = [ { src: "./icons/*", dest: "dist/assets/icons" }, ]; +function manualChunks(id) { + if (id.includes('node_modules')) { + return 'vendor'; + } + if (id.includes("src/api/")) { + return "api"; + } +} + export default [ { input: "./src/main.ts", @@ -26,6 +35,7 @@ export default [ format: "es", dir: "dist", sourcemap: true, + manualChunks: manualChunks, }, ], plugins: [ @@ -55,6 +65,7 @@ export default [ format: "es", dir: "dist", sourcemap: true, + manualChunks: manualChunks, }, ], plugins: [