From 75f920d496ae90fe09ed16e9d94d0a3c3bb431c0 Mon Sep 17 00:00:00 2001 From: elinuxhenrik Date: Fri, 4 Jun 2021 15:45:41 +0200 Subject: [PATCH] Avoid cache problems Start using the "--output-hashing all" option when building to avoid cache problems in browser. Also introduce a production build to use when building the docker image. Issue-ID: NONRTRIC-529 Signed-off-by: elinuxhenrik Change-Id: Ic38ecb938076b1b62ee91356035b43bebc1a80cb --- webapp-frontend/Dockerfile | 2 +- webapp-frontend/package.json | 3 ++- .../src/app/policy/policy-instance/policy-instance.component.spec.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/webapp-frontend/Dockerfile b/webapp-frontend/Dockerfile index 30d5c2c..c4a07d2 100644 --- a/webapp-frontend/Dockerfile +++ b/webapp-frontend/Dockerfile @@ -28,7 +28,7 @@ RUN export CHROME_BIN=/usr/bin/chromium-browser ENV CHROME_BIN /usr/bin/chromium-browser RUN ./ng test --browsers ChromeHeadless --code-coverage=true --watch=false -RUN npm run-script build +RUN npm run-script build:prod ### STAGE 2: Run App ### FROM nginx:alpine diff --git a/webapp-frontend/package.json b/webapp-frontend/package.json index 75f7ced..6703911 100644 --- a/webapp-frontend/package.json +++ b/webapp-frontend/package.json @@ -5,7 +5,8 @@ "ng": "ng", "start": "ng serve --proxy-config proxy.conf.json", "start:mock": "ng serve --configuration=mock", - "build": "ng build", + "build": "ng build --output-hashing all", + "build:prod": "ng build --configuration production --build-optimizer --vendor-chunk", "test": "ng test --watch=true", "lint": "ng lint", "e2e": "ng e2e", diff --git a/webapp-frontend/src/app/policy/policy-instance/policy-instance.component.spec.ts b/webapp-frontend/src/app/policy/policy-instance/policy-instance.component.spec.ts index 4a50046..7060cc9 100644 --- a/webapp-frontend/src/app/policy/policy-instance/policy-instance.component.spec.ts +++ b/webapp-frontend/src/app/policy/policy-instance/policy-instance.component.spec.ts @@ -517,7 +517,7 @@ describe("PolicyInstanceComponent", () => { }); describe("#truncate data", () => { - fit("should verify that data is correctly truncated when needed", async () => { + it("should verify that data is correctly truncated when needed", async () => { policyServiceSpy.getPolicyInstancesByType.and.returnValue( of(policyInstances) ); -- 2.16.6