refactor: only copy assets used at runtime in the bundle
[e-mobility-charging-stations-simulator.git] / rollup.config.mjs
index e78c1e9e26e145eaffa217fb2b0813520e9cf6c4..e660242612b1a9892dd84a0daa390819f3356dda 100644 (file)
@@ -2,8 +2,8 @@
 import json from '@rollup/plugin-json';
 import terser from '@rollup/plugin-terser';
 import typescript from '@rollup/plugin-typescript';
+import { copy } from '@web/rollup-plugin-copy';
 import analyze from 'rollup-plugin-analyzer';
-import copy from 'rollup-plugin-copy';
 import del from 'rollup-plugin-delete';
 
 const isDevelopmentBuild = process.env.BUILD === 'development';
@@ -68,7 +68,14 @@ export default {
       ],
     }),
     copy({
-      targets: [{ src: 'src/assets', dest: 'dist/' }],
+      rootDir: 'src',
+      patterns: 'assets/**/*.json',
+      exclude: [
+        'assets/config-template.json',
+        'assets/*config[-_]*.json',
+        'assets/idtags-template.json',
+        'assets/ui-protocol/**/*',
+      ],
     }),
     isAnalyzeBuild && analyze(),
   ],