From 00ffb46a1f68e64b8632407cb9818d2a2f8afffb Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Mon, 26 Aug 2019 15:44:13 +0200
Subject: [PATCH] Update deps and port to new apis

---
 .../karma.conf.js                                  |  2 +-
 .../package.json                                   | 10 +++++-----
 .../rollup.config.js                               | 14 +++++++-------
 .../vendor/auth                                    |  2 +-
 .../vendor/common                                  |  2 +-
 5 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/packages/knowledge-base-web-page-element-view/karma.conf.js b/packages/knowledge-base-web-page-element-view/karma.conf.js
index 901e0780..6a646f5e 100644
--- a/packages/knowledge-base-web-page-element-view/karma.conf.js
+++ b/packages/knowledge-base-web-page-element-view/karma.conf.js
@@ -6,7 +6,7 @@ module.exports = function(config) {
     basePath: 'dist',
     frameworks: ['mocha', 'chai'],
     files: [
-      './bundle.js',
+      {pattern: './*.js', included: true, watched: true, served: true, type: 'module'},
       {pattern: './**/*', included: false, watched: true, served: true},
     ],
     autoWatch: true,
diff --git a/packages/knowledge-base-web-page-element-view/package.json b/packages/knowledge-base-web-page-element-view/package.json
index 099fcab1..68281357 100644
--- a/packages/knowledge-base-web-page-element-view/package.json
+++ b/packages/knowledge-base-web-page-element-view/package.json
@@ -12,14 +12,14 @@
     "mocha": "^6.2.0",
     "chai": "^4.2.0",
     "rollup": "^1.11.3",
-    "rollup-plugin-commonjs": "^9.3.4",
-    "rollup-plugin-copy": "^2.0.1",
-    "rollup-plugin-node-resolve": "^4.2.3",
+    "rollup-plugin-commonjs": "^10.0.2",
+    "rollup-plugin-consts": "^1.0.1",
+    "rollup-plugin-copy": "^3.1.0",
+    "rollup-plugin-node-resolve": "^5.2.0",
     "rollup-plugin-postcss": "^2.0.3",
     "rollup-plugin-serve": "^1.0.1",
-    "rollup-plugin-terser": "^4.0.4",
+    "rollup-plugin-terser": "^5.1.1",
     "rollup-plugin-json": "^4.0.0",
-    "rollup-plugin-replace": "^2.2.0",
     "rollup-plugin-multi-entry": "^2.1.0",
     "i18next-scanner": "^2.10.2",
     "vpu-auth": "file:./vendor/auth",
diff --git a/packages/knowledge-base-web-page-element-view/rollup.config.js b/packages/knowledge-base-web-page-element-view/rollup.config.js
index 76af70d8..c225a449 100644
--- a/packages/knowledge-base-web-page-element-view/rollup.config.js
+++ b/packages/knowledge-base-web-page-element-view/rollup.config.js
@@ -5,9 +5,9 @@ import postcss from 'rollup-plugin-postcss';
 import copy from 'rollup-plugin-copy';
 import {terser} from "rollup-plugin-terser";
 import json from 'rollup-plugin-json';
-import replace from "rollup-plugin-replace";
 import serve from 'rollup-plugin-serve';
 import multiEntry from 'rollup-plugin-multi-entry';
+import consts from 'rollup-plugin-consts';
 
 const build = (typeof process.env.BUILD !== 'undefined') ? process.env.BUILD : 'local';
 console.log("build: " + build);
@@ -20,6 +20,9 @@ export default {
     },
     plugins: [
         multiEntry(),
+        consts({
+            environment: build,
+        }),
         resolve({
             customResolveOptions: {
                 // ignore node_modules from vendored packages
@@ -30,9 +33,6 @@ export default {
             include: 'node_modules/**'
         }),
         json(),
-        replace({
-            "process.env.BUILD": '"' + build + '"',
-        }),
         postcss({
             inject: false,
             minimize: false,
@@ -41,10 +41,10 @@ export default {
         (build !== 'local' && build !== 'test') ? terser() : false,
         copy({
             targets: [
-                'assets/index.html',
-                'assets/favicon.ico'
+                {src: 'assets/index.html', dest: 'dist'},
+                {src: 'assets/favicon.ico', dest: 'dist'},
+                {src: 'node_modules/material-design-icons-svg/paths/*.json', dest: 'dist/local/vpu-common/icons'},
             ],
-            outputFolder: 'dist'
         }),
         (process.env.ROLLUP_WATCH === 'true') ? serve({contentBase: 'dist', host: '127.0.0.1', port: 8002}) : false
     ]
diff --git a/packages/knowledge-base-web-page-element-view/vendor/auth b/packages/knowledge-base-web-page-element-view/vendor/auth
index 15f24eeb..6a6413f4 160000
--- a/packages/knowledge-base-web-page-element-view/vendor/auth
+++ b/packages/knowledge-base-web-page-element-view/vendor/auth
@@ -1 +1 @@
-Subproject commit 15f24eeb6873fa016b24cc2913073d613c3c4349
+Subproject commit 6a6413f48e0cd5508546841905f73a9486211bd0
diff --git a/packages/knowledge-base-web-page-element-view/vendor/common b/packages/knowledge-base-web-page-element-view/vendor/common
index 8a80921c..f65096b9 160000
--- a/packages/knowledge-base-web-page-element-view/vendor/common
+++ b/packages/knowledge-base-web-page-element-view/vendor/common
@@ -1 +1 @@
-Subproject commit 8a80921c5f8ea2b0d1a0a548741d2ca1716a5139
+Subproject commit f65096b99b737a046d07ad6616eec31788850422
-- 
GitLab