changeset 1069:51e42c2e110a

fix: Re-enable PurgeCSS This commit undoes d025e1f5e71d. PurgeCSS was deactivated, because logs did not highlight properly. Because of the strict timeline it seemed to be best, to deactivate PurgeCSS. PurgeCSS stripped hljs CSS because of how PurgeCSS works: As long as there are no references in your codebase, CSS is stripped. To prevent PurgeCSS from stripping, magically appearing CSS has to be referenced in the Code somewhere. Here: In the according section where the highlighted code appears. PurgeCSS works fully the way expected. Caveat für magically appearing styles.
author Thomas Junk <thomas.junk@intevation.de>
date Fri, 26 Oct 2018 10:00:25 +0200
parents c933665b0193
children 12312fb1cda2
files client/src/logs/logs.vue client/vue.config.js
diffstat 2 files changed, 23 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/logs/logs.vue	Fri Oct 26 09:36:13 2018 +0200
+++ b/client/src/logs/logs.vue	Fri Oct 26 10:00:25 2018 +0200
@@ -3,17 +3,25 @@
         <div class="d-flex flex-row">
             <div :class="spacer"></div>
             <div class="logoutput shadow">
-                <pre id="code" v-highlightjs="logs"><code class="bash"></code></pre>
+                <pre id="code" v-highlightjs="logs"><code class="bash hljs hljs-string"></code></pre>
             </div>
         </div>
         <div class="d-flex flex-row logmenu">
             <div class="d-flex align-self-center">
                 <ul class="nav nav-pills">
                     <li class="nav-item">
-                        <a @click="fetch('system/log/apache2/access.log', 'accesslog')" :class="accesslogStyle" href="#">Accesslog</a>
+                        <a
+                            @click="fetch('system/log/apache2/access.log', 'accesslog')"
+                            :class="accesslogStyle"
+                            href="#"
+                        >Accesslog</a>
                     </li>
                     <li class="nav-item">
-                        <a @click="fetch('system/log/apache2/error.log', 'errorlog')" :class="errorlogStyle" href="#">Errorlog</a>
+                        <a
+                            @click="fetch('system/log/apache2/error.log', 'errorlog')"
+                            :class="errorlogStyle"
+                            href="#"
+                        >Errorlog</a>
                     </li>
                 </ul>
             </div>
--- a/client/vue.config.js	Fri Oct 26 09:36:13 2018 +0200
+++ b/client/vue.config.js	Fri Oct 26 10:00:25 2018 +0200
@@ -1,7 +1,7 @@
 const CopyWebpackPlugin = require("copy-webpack-plugin");
-// const PurgecssPlugin = require("purgecss-webpack-plugin");
-// const glob = require("glob-all");
-// const path = require("path");
+const PurgecssPlugin = require("purgecss-webpack-plugin");
+const glob = require("glob-all");
+const path = require("path");
 
 module.exports = {
   outputDir: "../web",
@@ -13,15 +13,15 @@
       .use(CopyWebpackPlugin, [[{ from: vendorImgPath, to: "img" }]], {
         copyUnmodified: true
       });
-    // config.plugin("PurgecssPlugin").use(PurgecssPlugin, [
-    //   {
-    //     paths: glob.sync([
-    //       path.join(__dirname, "./src/index.html"),
-    //       path.join(__dirname, "./**/*.vue"),
-    //       path.join(__dirname, "./src/**/*.js")
-    //     ])
-    //   }
-    // ]);
+    config.plugin("PurgecssPlugin").use(PurgecssPlugin, [
+      {
+        paths: glob.sync([
+          path.join(__dirname, "./src/index.html"),
+          path.join(__dirname, "./**/*.vue"),
+          path.join(__dirname, "./src/**/*.js")
+        ])
+      }
+    ]);
   },
   css: {
     loaderOptions: {