repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
README.md: section name refinement
[e-mobility-charging-stations-simulator.git]
/
rollup.config.js
diff --git
a/rollup.config.js
b/rollup.config.js
index 9a8b5955b315e4bcac6905f4271171ff379ebd82..e086e90909abc0385768a0ba84ed847edf964e0b 100644
(file)
--- a/
rollup.config.js
+++ b/
rollup.config.js
@@
-1,23
+1,59
@@
+import analyze from 'rollup-plugin-analyzer';
+import copy from 'rollup-plugin-copy';
import del from 'rollup-plugin-delete';
import del from 'rollup-plugin-delete';
-import ts from '@wessberg/rollup-plugin-ts';
+import istanbul from 'rollup-plugin-istanbul';
+import json from '@rollup/plugin-json';
+import { terser } from 'rollup-plugin-terser';
+import ts from 'rollup-plugin-ts';
+
+const isDevelopmentBuild = process.env.BUILD === 'development';
export default {
export default {
- input: ['src/start.ts', 'src/charging-station/StationWorker.ts'],
+ input: ['src/start.ts', 'src/charging-station/
Charging
StationWorker.ts'],
output: {
dir: 'dist',
format: 'cjs',
exports: 'auto',
sourcemap: true,
preserveModules: true,
output: {
dir: 'dist',
format: 'cjs',
exports: 'auto',
sourcemap: true,
preserveModules: true,
- preserveModulesRoot: 'src'
+ preserveModulesRoot: 'src',
+ ...(!isDevelopmentBuild && { plugins: [terser({ numWorkers: 2 })] }),
},
},
- external: ['crypto', 'perf_hooks', 'fs', 'poolifier', 'uuid', 'ws', 'winston', 'winston-daily-rotate-file', 'worker_threads'],
+ external: [
+ 'basic-ftp',
+ 'chalk',
+ 'crypto',
+ 'fs',
+ '@mikro-orm/core',
+ '@mikro-orm/reflection',
+ 'mongodb',
+ 'path',
+ 'perf_hooks',
+ 'poolifier',
+ 'proper-lockfile',
+ 'reflect-metadata',
+ 'tar',
+ 'url',
+ 'uuid',
+ 'ws',
+ 'winston-daily-rotate-file',
+ 'winston/lib/winston/transports',
+ 'winston',
+ 'worker_threads',
+ ],
plugins: [
plugins: [
+ json(),
ts({
ts({
- tsconfig: 'tsconfig.json'
+ tsconfig: 'tsconfig.json',
+ browserslist: false,
}),
}),
+ isDevelopmentBuild && istanbul(),
del({
del({
- targets: 'dist/*'
- })
- ]
+ targets: ['dist/*', '!dist/assets', 'dist/assets/*.json', 'dist/assets/station-templates'],
+ }),
+ copy({
+ targets: [{ src: 'src/assets', dest: 'dist/' }],
+ }),
+ isDevelopmentBuild && analyze(),
+ ],
};
};