Skip to content
Snippets Groups Projects
Commit c2463a9f authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Add a new watch-full mode including babel/terser etc

watch should be faster now, watch-full is the same as a production build, but slow
parent 11308843
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,10 @@ git submodule update --init ...@@ -14,7 +14,10 @@ git submodule update --init
npm install npm install
# constantly build dist/bundle.js and run a local web-server on port 8001 # constantly build dist/bundle.js and run a local web-server on port 8001
npm run watch-local npm run watch
# same as watch, but with babel, terser, etc active -> very slow
npm run watch-full
# run tests # run tests
npm test npm test
......
...@@ -68,9 +68,9 @@ ...@@ -68,9 +68,9 @@
"build-demo": "rollup -c --environment BUILD:demo", "build-demo": "rollup -c --environment BUILD:demo",
"build-test": "rollup -c --environment BUILD:test", "build-test": "rollup -c --environment BUILD:test",
"i18next": "i18next-scanner", "i18next": "i18next-scanner",
"watch": "npm run watch-local", "watch": "rollup -c --watch",
"watch-local": "rollup -c --watch", "watch-local": "npm run watch",
"watch-dev": "rollup -c --watch --environment BUILD:development", "watch-full": "rollup -c --watch --environment WATCH_FULL",
"test": "npm run build-test && karma start --singleRun", "test": "npm run build-test && karma start --singleRun",
"lint": "eslint ." "lint": "eslint ."
} }
......
...@@ -29,6 +29,7 @@ const USE_HTTPS = false; ...@@ -29,6 +29,7 @@ const USE_HTTPS = false;
const pkg = require('./package.json'); const pkg = require('./package.json');
const build = (typeof process.env.BUILD !== 'undefined') ? process.env.BUILD : 'local'; const build = (typeof process.env.BUILD !== 'undefined') ? process.env.BUILD : 'local';
const watch = process.env.ROLLUP_WATCH === 'true'; const watch = process.env.ROLLUP_WATCH === 'true';
const watchFull = process.env.WATCH_FULL !== undefined;
console.log("build: " + build); console.log("build: " + build);
let basePath = ''; let basePath = '';
let entryPointURL = ''; let entryPointURL = '';
...@@ -37,9 +38,9 @@ let keyCloakBaseURL = ''; ...@@ -37,9 +38,9 @@ let keyCloakBaseURL = '';
let keyCloakClientId = ''; let keyCloakClientId = '';
let pdfAsQualifiedlySigningServer = ''; let pdfAsQualifiedlySigningServer = '';
let matomoSiteId = 131; let matomoSiteId = 131;
let useTerser = true; let useTerser = !watch || watchFull;
let useBabel = true; let useBabel = !watch || watchFull;
let checkLicenses = !watch; let checkLicenses = !watch || watchFull;
switch (build) { switch (build) {
case 'local': case 'local':
...@@ -49,7 +50,6 @@ switch (build) { ...@@ -49,7 +50,6 @@ switch (build) {
keyCloakBaseURL = 'https://' + keyCloakServer + '/auth'; keyCloakBaseURL = 'https://' + keyCloakServer + '/auth';
keyCloakClientId = 'auth-dev-mw-frontend-local'; keyCloakClientId = 'auth-dev-mw-frontend-local';
pdfAsQualifiedlySigningServer = 'sig-dev.tugraz.at'; pdfAsQualifiedlySigningServer = 'sig-dev.tugraz.at';
useTerser = false;
break; break;
case 'development': case 'development':
basePath = '/apps/signature/'; basePath = '/apps/signature/';
...@@ -83,7 +83,6 @@ switch (build) { ...@@ -83,7 +83,6 @@ switch (build) {
keyCloakBaseURL = ''; keyCloakBaseURL = '';
keyCloakClientId = ''; keyCloakClientId = '';
pdfAsQualifiedlySigningServer = ''; pdfAsQualifiedlySigningServer = '';
useTerser = false;
break; break;
default: default:
console.error('Unknown build environment: ' + build); console.error('Unknown build environment: ' + build);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment