From dd0bb16e58d966cbdf0ab52cf0f3ca3629f6049a Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 9 Jun 2017 22:03:02 -0700 Subject: [PATCH 1/3] update webpack.dev.config for v2 --- ui/package.json | 4 ++-- ui/webpack.config.js | 2 +- ui/webpack.dev.config.js | 39 +++++++++++++++++++++------------------ 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/ui/package.json b/ui/package.json index a079118a3..2c4913238 100644 --- a/ui/package.json +++ b/ui/package.json @@ -42,7 +42,7 @@ "devDependencies": { "babel": "^6.5.2", "babel-core": "^6.18.2", - "babel-loader": "^6.2.8", + "babel-loader": "^6.4.1", "babel-plugin-react-require": "^3.0.0", "babel-polyfill": "^6.20.0", "babel-preset-es2015": "^6.18.0", @@ -59,7 +59,7 @@ "lint-staged": "^3.6.0", "node-sass": "^3.13.0", "prettier": "^1.4.2", - "webpack": "^1.13.3", + "webpack": "^2.6.1", "webpack-dev-server": "^2.4.4", "webpack-notifier": "^1.5.0", "webpack-target-electron-renderer": "^0.4.0" diff --git a/ui/webpack.config.js b/ui/webpack.config.js index 59c2fd6d5..fe3bd5c99 100644 --- a/ui/webpack.config.js +++ b/ui/webpack.config.js @@ -50,4 +50,4 @@ module.exports = { ] }, target: 'electron-main', -}; \ No newline at end of file +}; diff --git a/ui/webpack.dev.config.js b/ui/webpack.dev.config.js index 232f6dcc3..d5332f332 100644 --- a/ui/webpack.dev.config.js +++ b/ui/webpack.dev.config.js @@ -17,43 +17,46 @@ module.exports = { filename: "bundle.js", pathinfo: true }, - debug: true, cache: true, devtool: 'eval', resolve: { - root: appPath, - extensions: ['', '.js', '.jsx', '.css'], + modules: [appPath, "node_modules"], + extensions: ['.js', '.jsx', '.css'] }, plugins: [ new WebpackNotifierPlugin(), new webpack.DefinePlugin({ ENV: JSON.stringify("development"), }), + new webpack.LoaderOptionsPlugin({ + debug: true + }) ], module: { - preLoaders: [ + rules: [ { test: /\.jsx?$/, + enforce: "pre", loaders: ['eslint'], // define an include so we check just the files we need include: PATHS.app - } - ], - loaders: [ - { test: /\.css$/, loader: "style!css" }, + }, + { + test: /\.css$/, + use: ["style-loader", "css-loader"] + }, { test: /\.jsx?$/, - loader: 'babel', - query: { - cacheDirectory: true, - presets:[ 'es2015', 'react', 'stage-2' ] + exclude: /node_modules/, + use: { + loader: 'babel-loader', + options: { + cacheDirectory: true, + presets: [ 'es2015', 'react', 'stage-2' ] + } } - }, - { - test: /mime\.json$/, - loader: 'json', - }, + } ] }, target: 'electron-main', -}; \ No newline at end of file +}; From d4afa34d482b0893c20a2820ace0e0f9d24af21b Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 9 Jun 2017 22:13:11 -0700 Subject: [PATCH 2/3] update webpack.config for v2 --- ui/webpack.config.js | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/ui/webpack.config.js b/ui/webpack.config.js index fe3bd5c99..b9267fd29 100644 --- a/ui/webpack.config.js +++ b/ui/webpack.config.js @@ -16,8 +16,8 @@ module.exports = { }, devtool: 'source-map', resolve: { - root: appPath, - extensions: ['', '.js', '.jsx', '.css'], + modules: [appPath, "node_modules"], + extensions: ['.js', '.jsx', '.css'] }, plugins: [ new webpack.DefinePlugin({ @@ -25,28 +25,29 @@ module.exports = { }), ], module: { - preLoaders: [ + rules: [ { test: /\.jsx?$/, + enforce: "pre", loaders: ['eslint'], // define an include so we check just the files we need include: PATHS.app - } - ], - loaders: [ - { test: /\.css$/, loader: "style!css" }, + }, + { + test: /\.css$/, + use: ["style-loader", "css-loader"] + }, { test: /\.jsx?$/, - loader: 'babel', - query: { - cacheDirectory: true, - presets:[ 'es2015', 'react', 'stage-2' ] + exclude: /node_modules/, + use: { + loader: 'babel-loader', + options: { + cacheDirectory: true, + presets: [ 'es2015', 'react', 'stage-2' ] + } } - }, - { - test: /mime\.json$/, - loader: 'json', - }, + } ] }, target: 'electron-main', From 3a89a75e7d914fca985edc39f07e0a4f6df887d3 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Sat, 10 Jun 2017 21:59:33 -0700 Subject: [PATCH 3/3] consistent quote type --- ui/webpack.config.js | 28 ++++++++++++++-------------- ui/webpack.dev.config.js | 30 +++++++++++++++--------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/ui/webpack.config.js b/ui/webpack.config.js index b9267fd29..b0ab6f08a 100644 --- a/ui/webpack.config.js +++ b/ui/webpack.config.js @@ -1,23 +1,23 @@ -const path = require('path'); -const webpack = require('webpack') -const appPath = path.resolve(__dirname, 'js'); +const path = require("path"); +const webpack = require("webpack") +const appPath = path.resolve(__dirname, "js"); const PATHS = { - app: path.join(__dirname, 'app'), - dist: path.join(__dirname, 'dist') + app: path.join(__dirname, "app"), + dist: path.join(__dirname, "dist") }; module.exports = { - entry: ['babel-polyfill', './js/main.js'], + entry: ["babel-polyfill", "./js/main.js"], output: { - path: path.join(PATHS.dist, 'js'), - publicPath: '/js/', + path: path.join(PATHS.dist, "js"), + publicPath: "/js/", filename: "bundle.js" }, - devtool: 'source-map', + devtool: "source-map", resolve: { modules: [appPath, "node_modules"], - extensions: ['.js', '.jsx', '.css'] + extensions: [".js", ".jsx", ".css"] }, plugins: [ new webpack.DefinePlugin({ @@ -29,7 +29,7 @@ module.exports = { { test: /\.jsx?$/, enforce: "pre", - loaders: ['eslint'], + loaders: ["eslint"], // define an include so we check just the files we need include: PATHS.app }, @@ -41,14 +41,14 @@ module.exports = { test: /\.jsx?$/, exclude: /node_modules/, use: { - loader: 'babel-loader', + loader: "babel-loader", options: { cacheDirectory: true, - presets: [ 'es2015', 'react', 'stage-2' ] + presets: [ "es2015", "react", "stage-2" ] } } } ] }, - target: 'electron-main', + target: "electron-main", }; diff --git a/ui/webpack.dev.config.js b/ui/webpack.dev.config.js index d5332f332..42107a3c5 100644 --- a/ui/webpack.dev.config.js +++ b/ui/webpack.dev.config.js @@ -1,27 +1,27 @@ -const path = require('path'); -const webpack = require('webpack') -const WebpackNotifierPlugin = require('webpack-notifier') +const path = require("path"); +const webpack = require("webpack") +const WebpackNotifierPlugin = require("webpack-notifier") -const appPath = path.resolve(__dirname, 'js'); +const appPath = path.resolve(__dirname, "js"); const PATHS = { - app: path.join(__dirname, 'app'), - dist: path.join(__dirname, '..', 'app', 'dist') + app: path.join(__dirname, "app"), + dist: path.join(__dirname, "..", "app", "dist") }; module.exports = { - entry: ['babel-polyfill', './js/main.js'], + entry: ["babel-polyfill", "./js/main.js"], output: { - path: path.join(PATHS.dist, 'js'), - publicPath: '/js/', + path: path.join(PATHS.dist, "js"), + publicPath: "/js/", filename: "bundle.js", pathinfo: true }, cache: true, - devtool: 'eval', + devtool: "eval", resolve: { modules: [appPath, "node_modules"], - extensions: ['.js', '.jsx', '.css'] + extensions: [".js", ".jsx", ".css"] }, plugins: [ new WebpackNotifierPlugin(), @@ -37,7 +37,7 @@ module.exports = { { test: /\.jsx?$/, enforce: "pre", - loaders: ['eslint'], + loaders: ["eslint"], // define an include so we check just the files we need include: PATHS.app }, @@ -49,14 +49,14 @@ module.exports = { test: /\.jsx?$/, exclude: /node_modules/, use: { - loader: 'babel-loader', + loader: "babel-loader", options: { cacheDirectory: true, - presets: [ 'es2015', 'react', 'stage-2' ] + presets: [ "es2015", "react", "stage-2" ] } } } ] }, - target: 'electron-main', + target: "electron-main", };