Skip to content

Instantly share code, notes, and snippets.

@LeZuse
Created October 5, 2017 15:23
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LeZuse/d79e17a934aa0878248544df2b2570d6 to your computer and use it in GitHub Desktop.
Save LeZuse/d79e17a934aa0878248544df2b2570d6 to your computer and use it in GitHub Desktop.
Restart Webpack on config change
$ yarn start
yarn run v1.1.0
$ nodemon
[nodemon] 1.12.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: webpack/webpack.config.js
[nodemon] starting `webpack-dev-server --config webpack/webpack.config.js`
Project is running at https://localhost:4201/
webpack output is served from /assets/
Content not from webpack is served from ***
Hash: bb03a7937a60dda34b0a
Version: webpack 3.6.0
Time: 3268ms
Asset Size Chunks Chunk Names
main.js 2.95 MB 0 [emitted] [big] main
[115] multi (webpack)-dev-server/client?https://localhost:4201 ../app.js 40 bytes {0} [built]
[116] (webpack)-dev-server/client?https://localhost:4201 7.23 kB {0} [built]
[117] ***/node_modules/url/url.js 23.3 kB {0} [built]
[120] ***/node_modules/querystring-es3/index.js 127 bytes {0} [built]
[123] ***/node_modules/strip-ansi/index.js 161 bytes {0} [built]
[125] ***/node_modules/loglevel/lib/loglevel.js 7.74 kB {0} [built]
[126] (webpack)-dev-server/client/socket.js 1.04 kB {0} [built]
[158] (webpack)-dev-server/client/overlay.js 3.73 kB {0} [built]
[159] ***/node_modules/ansi-html/index.js 4.26 kB {0} [built]
[163] (webpack)/hot nonrecursive ^\.\/log$ 170 bytes {0} [built]
[165] (webpack)/hot/emitter.js 77 bytes {0} [built]
[167] ./app.js 562 bytes {0} [built]
[168] ***/node_modules/react/react.js 56 bytes {0} [built]
[184] ***/node_modules/react-dom/index.js 59 bytes {0} [built]
[185] ***/node_modules/react-dom/lib/ReactDOM.js 5.05 kB {0} [built]
+ 255 hidden modules
webpack: Compiled successfully.
{
"watch": "webpack/webpack.config.js",
"exec": "webpack-dev-server --config webpack/webpack.config.js"
}
{
"scripts": {
"start": "nodemon",
},
"devDependencies": {
"nodemon": "^1.12.1",
"webpack": "^3.6.0",
"webpack-dev-server": "^2.9.1"
}
}
@MichaelHabib
Copy link

THANK YOU .. this works like magic !
Combining this with LiveReload plugin to automate all reloading :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment