Skip to content

Commit 6dfcabf

Browse files
esphensapegin
authored andcommitted
Fix: Allow devServer.watchConfig to be configured (#516)
This also means Vagrant is now supported
1 parent 8c68f01 commit 6dfcabf

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

docs/Cookbook.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,20 @@ initialState = {
390390
</div>
391391
```
392392

393+
## How to use Vagrant with Styleguidist?
394+
395+
First of all, make sure you read [this guide](https://webpack.js.org/guides/development-vagrant/) from the webpack documentation.
396+
397+
Then enable polling in your webpack config:
398+
399+
```js
400+
devServer: {
401+
watchOptions: {
402+
poll: true,
403+
},
404+
},
405+
```
406+
393407
## Are there any other projects like this?
394408

395409
* [Atellier](https://github.com/scup/atellier), a React components emulator.

scripts/create-server.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
const webpack = require('webpack');
44
const WebpackDevServer = require('webpack-dev-server');
5+
const merge = require('webpack-merge');
56
const makeWebpackConfig = require('./make-webpack-config');
67

78
module.exports = function createServer(config, env) {
89
const webpackConfig = makeWebpackConfig(config, env);
9-
const webpackDevServerConfig = Object.assign({}, webpackConfig.devServer, {
10+
const webpackDevServerConfig = merge(webpackConfig.devServer, {
1011
noInfo: true,
1112
compress: true,
1213
clientLogLevel: 'none',

0 commit comments

Comments
 (0)