Browse Source

webpack prod removes console.log, + minor adjustments

Bachir Soussi Chiadmi 4 months ago
parent
commit
456ed221d8

+ 2 - 2
assets/css/app.scss

@@ -25,8 +25,8 @@ header[role="banner"]{
   // pointer-events: none;
   cursor: pointer;
   h2{
-    font-weight: 500;
-    font-size: 1em;
+    font-weight: 400;
+    font-size: 1.323em;
     margin:0;
   }
   h1{

+ 14 - 0
build/webpack.config.prod.js

@@ -3,6 +3,7 @@
 const merge = require('webpack-merge')
 const baseConfig = require('./webpack.config.base')
 const MiniCssExtractPlugin  = require('mini-css-extract-plugin')
+const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
 
 module.exports = merge(baseConfig, {
   mode: 'production',
@@ -16,6 +17,19 @@ module.exports = merge(baseConfig, {
         },
       },
     },
+    minimizer: [new UglifyJsPlugin({
+      sourceMap:true,
+      cache: true,
+      parallel: true,
+      uglifyOptions:{
+        ecma:8,
+        compress: {
+          // drop_console: true
+          pure_funcs: ['console.log']
+        }
+      },
+      exclude: 'vendor.js',
+    })]
   },
   module: {
     rules: [

+ 47 - 0
package-lock.json

@@ -14208,6 +14208,53 @@
         }
       }
     },
+    "uglifyjs-webpack-plugin": {
+      "version": "2.2.0",
+      "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-2.2.0.tgz",
+      "integrity": "sha512-mHSkufBmBuJ+KHQhv5H0MXijtsoA1lynJt1lXOaotja8/I0pR4L9oGaPIZw+bQBOFittXZg9OC1sXSGO9D9ZYg==",
+      "dev": true,
+      "requires": {
+        "cacache": "^12.0.2",
+        "find-cache-dir": "^2.1.0",
+        "is-wsl": "^1.1.0",
+        "schema-utils": "^1.0.0",
+        "serialize-javascript": "^1.7.0",
+        "source-map": "^0.6.1",
+        "uglify-js": "^3.6.0",
+        "webpack-sources": "^1.4.0",
+        "worker-farm": "^1.7.0"
+      },
+      "dependencies": {
+        "serialize-javascript": {
+          "version": "1.9.1",
+          "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.9.1.tgz",
+          "integrity": "sha512-0Vb/54WJ6k5v8sSWN09S0ora+Hnr+cX40r9F170nT+mSkaxltoE/7R3OrIdBSUv1OoiobH1QoWQbCnAO+e8J1A==",
+          "dev": true
+        },
+        "source-map": {
+          "version": "0.6.1",
+          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+          "dev": true
+        },
+        "uglify-js": {
+          "version": "3.11.3",
+          "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.11.3.tgz",
+          "integrity": "sha512-wDRziHG94mNj2n3R864CvYw/+pc9y/RNImiTyrrf8BzgWn75JgFSwYvXrtZQMnMnOp/4UTrf3iCSQxSStPiByA==",
+          "dev": true
+        },
+        "webpack-sources": {
+          "version": "1.4.3",
+          "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz",
+          "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==",
+          "dev": true,
+          "requires": {
+            "source-list-map": "^2.0.0",
+            "source-map": "~0.6.1"
+          }
+        }
+      }
+    },
     "unicode-canonical-property-names-ecmascript": {
       "version": "1.0.4",
       "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz",

+ 1 - 0
package.json

@@ -64,6 +64,7 @@
     "stylus": "^0.54.7",
     "stylus-loader": "^3.0.2",
     "uglify-es": "^3.3.9",
+    "uglifyjs-webpack-plugin": "^2.2.0",
     "url-loader": "^1.1.2",
     "vue-jest": "^3.0.6",
     "vue-loader": "^15.9.3",

+ 4 - 4
src/App.vue

@@ -382,19 +382,19 @@ export default {
             this.controls.lat = 0
             switch (vnode.face) {
               case 'left':
-                toPos.x += 1.5
+                toPos.x += 2.5
                 this.controls.lon = 180
                 break
               case 'back':
-                toPos.z += 1.5
+                toPos.z += 2.5
                 this.controls.lon = -90
                 break
               case 'right':
-                toPos.x -= 1.5
+                toPos.x -= 2.5
                 this.controls.lon = 0
                 break
               case 'front':
-                toPos.z -= 1.5
+                toPos.z -= 2.5
                 this.controls.lon = 90
                 break
             }

+ 2 - 2
src/components/Content.vue

@@ -13,8 +13,8 @@
         <h1>{{ data.Name }}</h1>
       </header>
       <section>
-        <div v-if="data.Text" class="text">
-          {{ data.Text }}
+        <div v-if="data.Text2" class="text">
+          {{ data.Text2 }}
         </div>
         <div v-if="data.Vimeo" class="vimeo" v-html="data.Vimeo.html"/>
         <ul v-if="data.Media && data.Media.length">

+ 2 - 2
src/components/objects/ContentBlock.vue

@@ -139,10 +139,10 @@ export default {
       // console.log('this.data.country.id', parseInt(this.data.country.id))
       switch (parseInt(this.data.country.id)) {
         case 1:
-          this.face = 'right'
+          this.face = 'back'
           break
         case 2:
-          this.face = 'back'
+          this.face = 'right'
           break
         case 3:
           this.face = 'left'

+ 13 - 4
src/store/modules/project.js

@@ -521,7 +521,7 @@ export default {
           project(id: "${state.id}") {
             visibles(
               where: {Published: "true"},
-              sort: "Weight:desc"
+              sort: "Weight:asc"
             ){
               id
               Name
@@ -539,7 +539,10 @@ export default {
               }
               Weight
             }
-            contexts(where: { Published: "true" }){
+            contexts(
+              where: { Published: "true" },
+              sort: "Weight:asc"
+            ){
               id
               Name
               Images {
@@ -554,7 +557,10 @@ export default {
                 Name
               }
             }
-            processes(where: { Published: "true" }){
+            processes(
+              where: { Published: "true" },
+              sort: "Weight:asc"
+            ){
               id
               Name
               Media {
@@ -569,7 +575,10 @@ export default {
                 Name
               }
             }
-            concepts(where: { Published: "true" }){
+            concepts(
+              where: { Published: "true" },
+              sort: "Weight:asc"
+            ){
               id
               Name
               Images {