From 6f699a772f021169d878156a8bcc07c33f782622 Mon Sep 17 00:00:00 2001 From: Olivier Corradi Date: Mon, 5 Jun 2017 10:18:43 +0200 Subject: [PATCH] Update to node 8 --- docker-compose.yml | 2 +- web/Dockerfile | 2 +- web/app/countrytopos.js | 2 +- web/app/main.js | 6 +++--- web/package.json | 20 +++++++++----------- web/server.js | 3 +-- web/webpack.config.js | 6 +----- 7 files changed, 17 insertions(+), 24 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 033c74940b..f997df2e4c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: dockerfile: web/Dockerfile command: npm run server-dev environment: - - ENV=development + - NODE_ENV=development ports: ['8000:8000'] volumes: - './web/app:/home/web/app' diff --git a/web/Dockerfile b/web/Dockerfile index ebb23c0180..2c68346b8c 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -1,4 +1,4 @@ -FROM node:6.9.4 +FROM node:8.0.0 WORKDIR /home/web ADD web/package.json /home/web/package.json diff --git a/web/app/countrytopos.js b/web/app/countrytopos.js index 57495ba61e..9fc84e9f6b 100644 --- a/web/app/countrytopos.js +++ b/web/app/countrytopos.js @@ -1,7 +1,7 @@ var d3 = require('d3'); var topojson = require('topojson'); -var topos = require('json-loader!./world.json'); +var topos = require('./world.json'); var exports = module.exports = {}; diff --git a/web/app/main.js b/web/app/main.js index 9f9a717b97..34a1df86de 100644 --- a/web/app/main.js +++ b/web/app/main.js @@ -16,15 +16,15 @@ var ExchangeLayer = require('./exchangelayer'); var flags = require('./flags'); var grib = require('./grib'); var HorizontalColorbar = require('./horizontalcolorbar'); -var lang = require('json-loader!./configs/lang.json')[locale]; +var lang = require('./configs/lang.json')[locale]; var LoadingService = require('./loadingservice'); var Solar = require('./solar'); var Tooltip = require('./tooltip'); var Wind = require('./wind'); // Configs -var capacities = require('json-loader!../../config/capacities.json'); -var zones = require('json-loader!../../config/zones.json'); +var capacities = require('../../config/capacities.json'); +var zones = require('../../config/zones.json'); // Constants var REFRESH_TIME_MINUTES = 5; diff --git a/web/package.json b/web/package.json index f2a80c85d9..a962670892 100644 --- a/web/package.json +++ b/web/package.json @@ -3,22 +3,20 @@ "version": "0.0.1", "description": "", "dependencies": { - "async": "^2.0.1", "compression": "^1.6.2", "currency-symbol-map": "^3.1.0", - "d3": "^4.4.0", - "ejs": "^2.5.5", - "express": "^4.10.2", + "d3": "^4.9.1", + "ejs": "^2.5.6", + "express": "^4.15.3", "i18n": "^0.8.3", - "js-cookie": "^2.1.3", - "json-loader": "git://github.com/webpack/json-loader.git#780f438d6e47155496d0b8ac7a9a3b35edc65e9a", - "moment": "^2.15.2", - "opbeat": "^4.11.0", - "topojson": "^2.2.0" + "js-cookie": "^2.1.4", + "moment": "^2.18.1", + "opbeat": "^4.14.0", + "topojson": "^3.0.0" }, "devDependencies": { - "nodemon": "^1.10.2", - "webpack": "^1.13.3" + "nodemon": "^1.11.0", + "webpack": "^2.6.1" }, "repository": { "type": "git", diff --git a/web/server.js b/web/server.js index 97fced4843..059b988002 100644 --- a/web/server.js +++ b/web/server.js @@ -1,4 +1,4 @@ -var isProduction = process.env.ENV === 'production'; +var isProduction = process.env.NODE_ENV === 'production'; // * Opbeat (must be the first thing started) if (isProduction) { @@ -11,7 +11,6 @@ if (isProduction) { } // Modules -var async = require('async'); var compression = require('compression'); var d3 = require('d3'); var express = require('express'); diff --git a/web/webpack.config.js b/web/webpack.config.js index 0a47c81559..884df8ba7c 100644 --- a/web/webpack.config.js +++ b/web/webpack.config.js @@ -15,8 +15,7 @@ module.exports = { callback(); }); }, - new webpack.optimize.DedupePlugin(), - new webpack.optimize.OccurenceOrderPlugin(), + new webpack.optimize.OccurrenceOrderPlugin(), new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false @@ -41,8 +40,5 @@ module.exports = { output: { filename: 'bundle.' + (process.env.BUILD === 'debug' ? 'dev' : '[hash]') + '.js', path: __dirname + '/public/dist/' - }, - resolve: { - moduleDirectories: ['node_modules'] } };