From ff4bde6d4a7650dda19d67afb9f17db9797fc39b Mon Sep 17 00:00:00 2001 From: Hermann <blumh@student.ethz.ch> Date: Fri, 4 May 2018 21:34:45 +0200 Subject: [PATCH] more debugging --- src/auth.js | 1 + webpack.config.dev.js | 28 ++++++++++++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/auth.js b/src/auth.js index 613703c..17c3f74 100644 --- a/src/auth.js +++ b/src/auth.js @@ -55,6 +55,7 @@ export function checkAuthenticated() { return new Promise((resolve) => { if (APISession.authenticated) resolve(); else { + console.log(apiUrl); console.log('looking for token'); // let's see if we have a stored token const token = localStorage.get('token'); diff --git a/webpack.config.dev.js b/webpack.config.dev.js index e8d60b2..c2c2167 100644 --- a/webpack.config.dev.js +++ b/webpack.config.dev.js @@ -1,8 +1,28 @@ -// Start with prod config -const config = require('./webpack.config.prod.js'); -// Replace prod with dev config +const webpack = require('webpack'); +const CompressionPlugin = require('compression-webpack-plugin'); + +// Start with dev config +const config = require('./webpack.config.js'); + +// Remove development server and code map +config.devServer = undefined; +config.devtool = ''; + +// Add optimization plugins +config.plugins = [ + new webpack.optimize.UglifyJsPlugin(), + new webpack.optimize.AggressiveMergingPlugin(), + new CompressionPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: /\.js$|\.css$|\.html$/, + threshold: 10240, + minRatio: 0.8, + }), +]; + +// Replace development with production config config.resolve.alias.networkConfig = `${__dirname}/src/networkConfig.dev.json`; -console.log(config.resolve.alias.networkConfig); module.exports = config; -- GitLab