Skip to content

Commit

Permalink
(feat): hot-reload in-memory bundles with webpack-serve
Browse files Browse the repository at this point in the history
- webpack-serve is the more modern version of webpack-dev-server
  - made by some of the same folks I believe

- also add webpack-serve-waitpage for build progress and
  webpack-serve-overlay for error overlays
  - overlay needed a new entry so that it show errors that occur
    after it's conditionally `require`d

- debug a bunch of publicPath and routing issues and add more explicit
  comments
  - see webpack-contrib/file-loader#246 ,
    webpack/webpack-dev-middleware#269 , and
    webpack-contrib/webpack-serve#238
  - TODO: experiment with publicPath for production / CDN as it may
    not work perfectly anymore

- (docs): add docs for hmr and reword some of README
  • Loading branch information
agilgur5 committed Aug 10, 2018
1 parent ba326c5 commit d219b69
Show file tree
Hide file tree
Showing 5 changed files with 1,821 additions and 28 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ npm install

### Using the Environment

1. `npm run build:watch` starts Webpack in watch mode, rebundling the JS and CSS whenever the source files change, and outputting them into the `build/` folder as specified by the Webpack config
1. `npm run build:hmr` will run a [`webpack-serve`](https://github.com/webpack-contrib/webpack-serve) Node server
- This will rebundle and hot-reload the app whenever the source files change. The app will be served from memory at [localhost:8080](http://localhost:8080)
- <small>For a slower alternative that doesn't hot-reload, one can run `npm run build:watch` to output the bundle to disk on changes</small>

### Creating a Production Build

1. `npm run build:prod`
1. `npm run deploy` will clean the build folder and then output a production bundle with `npm run build:prod`

### Installing New Packages

Expand Down
Loading

0 comments on commit d219b69

Please sign in to comment.