Commit 19dd138c authored by Jacob Schatz's avatar Jacob Schatz

Merge branch '30678-improve-dev-server-process' into 'master'

Make webpack-dev-server process more resilient when switching branches.

Closes #30678

See merge request !10581
parents 100f4370 fa120a06
---
title: Keep webpack-dev-server process functional across branch changes
merge_request: 10581
author:
...@@ -374,3 +374,27 @@ ...@@ -374,3 +374,27 @@
:why: https://github.com/fb55/entities/blob/master/LICENSE :why: https://github.com/fb55/entities/blob/master/LICENSE
:versions: [] :versions: []
:when: 2017-04-07 16:19:23.900571000 Z :when: 2017-04-07 16:19:23.900571000 Z
- - :approve
- ansi-html
- :who: Mike Greiling
:why: https://github.com/Tjatse/ansi-html/blob/master/LICENSE
:versions: []
:when: 2017-04-10 05:42:12.898178000 Z
- - :approve
- map-stream
- :who: Mike Greiling
:why: https://github.com/dominictarr/map-stream/blob/master/LICENCE
:versions: []
:when: 2017-04-10 06:27:52.269085000 Z
- - :approve
- pause-stream
- :who: Mike Greiling
:why: https://github.com/dominictarr/pause-stream/blob/master/LICENSE
:versions: []
:when: 2017-04-10 06:28:39.825894000 Z
- - :approve
- undefsafe
- :who: Mike Greiling
:why: https://github.com/remy/undefsafe/blob/master/LICENSE
:versions: []
:when: 2017-04-10 06:30:00.002555000 Z
...@@ -6,6 +6,7 @@ var webpack = require('webpack'); ...@@ -6,6 +6,7 @@ var webpack = require('webpack');
var StatsPlugin = require('stats-webpack-plugin'); var StatsPlugin = require('stats-webpack-plugin');
var CompressionPlugin = require('compression-webpack-plugin'); var CompressionPlugin = require('compression-webpack-plugin');
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
var WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
var ROOT_PATH = path.resolve(__dirname, '..'); var ROOT_PATH = path.resolve(__dirname, '..');
var IS_PRODUCTION = process.env.NODE_ENV === 'production'; var IS_PRODUCTION = process.env.NODE_ENV === 'production';
...@@ -187,6 +188,10 @@ if (IS_DEV_SERVER) { ...@@ -187,6 +188,10 @@ if (IS_DEV_SERVER) {
inline: DEV_SERVER_LIVERELOAD inline: DEV_SERVER_LIVERELOAD
}; };
config.output.publicPath = '//localhost:' + DEV_SERVER_PORT + config.output.publicPath; config.output.publicPath = '//localhost:' + DEV_SERVER_PORT + config.output.publicPath;
config.plugins.push(
// watch node_modules for changes if we encounter a missing module compile error
new WatchMissingNodeModulesPlugin(path.join(ROOT_PATH, 'node_modules'))
);
} }
if (WEBPACK_REPORT) { if (WEBPACK_REPORT) {
......
{ {
"private": true, "private": true,
"scripts": { "scripts": {
"dev-server": "webpack-dev-server --config config/webpack.config.js", "dev-server": "nodemon --watch config/webpack.config.js -- ./node_modules/.bin/webpack-dev-server --config config/webpack.config.js",
"eslint": "eslint --max-warnings 0 --ext .js,.vue .", "eslint": "eslint --max-warnings 0 --ext .js,.vue .",
"eslint-fix": "eslint --max-warnings 0 --ext .js,.vue --fix .", "eslint-fix": "eslint --max-warnings 0 --ext .js,.vue --fix .",
"eslint-report": "eslint --max-warnings 0 --ext .js,.vue --format html --output-file ./eslint-report.html .", "eslint-report": "eslint --max-warnings 0 --ext .js,.vue --format html --output-file ./eslint-report.html .",
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
"pikaday": "^1.5.1", "pikaday": "^1.5.1",
"raphael": "^2.2.7", "raphael": "^2.2.7",
"raw-loader": "^0.5.1", "raw-loader": "^0.5.1",
"react-dev-utils": "^0.5.2",
"select2": "3.5.2-browserify", "select2": "3.5.2-browserify",
"stats-webpack-plugin": "^0.4.3", "stats-webpack-plugin": "^0.4.3",
"three": "^0.84.0", "three": "^0.84.0",
...@@ -69,6 +70,7 @@ ...@@ -69,6 +70,7 @@
"karma-phantomjs-launcher": "^1.0.2", "karma-phantomjs-launcher": "^1.0.2",
"karma-sourcemap-loader": "^0.3.7", "karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.2", "karma-webpack": "^2.0.2",
"nodemon": "^1.11.0",
"webpack-dev-server": "^2.4.2" "webpack-dev-server": "^2.4.2"
} }
} }
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment