Skip to content

Commit

Permalink
[INFRA] simplify rollup copy plugins configuration (#567)
Browse files Browse the repository at this point in the history
Avoid listing all static files to copy, so the maintenance should be easier, in
particular when adding new static files.
  • Loading branch information
tbouffard authored Sep 1, 2020
1 parent ef91204 commit b8c2260
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,13 @@ const plugins = [
// Copy static resources to dist
if (devMode || demoMode) {
const copyTargets = [];
// TODO configure with glob if possible to avoid listing all files manually (maintenance pain)
copyTargets.push({ src: 'src/index.html', dest: 'dist/' });
copyTargets.push({ src: 'src/non-regression.html', dest: 'dist/' });
copyTargets.push({ src: 'src/lib-integration.html', dest: 'dist/' });
copyTargets.push({ src: 'src/static/css/main.css', dest: 'dist/static/css/' });
copyTargets.push({ src: 'src/static/img/favicon.ico', dest: 'dist/static/img/' });
copyTargets.push({ src: 'src/static/js/configureMxGraphGlobals.js', dest: 'dist/static/js/' });
copyTargets.push({ src: 'src/static/js/demo.js', dest: 'dist/static/js/' });
copyTargets.push({ src: 'src/static/js/lib-integration.js', dest: 'dist/static/js/' });
copyTargets.push({ src: 'src/static/js/non-regression.js', dest: 'dist/static/js/' });
copyTargets.push({ src: 'src/*.html', dest: 'dist/' });
copyTargets.push({ src: 'src/static', dest: 'dist' });
copyTargets.push({ src: 'node_modules/mxgraph/javascript/mxClient.min.js', dest: 'dist/static/js/' });
let copyPlugin;
if (devLiveReloadMode) {
copyPlugin = copyWatch({
watch: ['src/static/**', 'src/index.html'],
watch: ['src/static/**', 'src/*.html'],
targets: copyTargets,
});
} else {
Expand Down

0 comments on commit b8c2260

Please sign in to comment.