forked from casesandberg/react-color
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docs-server.js
30 lines (24 loc) · 864 Bytes
/
docs-server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
'use strict'
var webpack = require('webpack')
var WebpackDevServer = require('webpack-dev-server')
var webpackConfig = require('./webpack.config.js')
let port = 9100
let docs = Object.create(webpackConfig)
docs.entry = ['webpack-dev-server/client?http://localhost:' + port, 'webpack/hot/dev-server', docs.entry[0]]
docs.module.loaders[0].loaders.unshift('react-hot-loader')
docs.module.loaders[1].loaders.unshift('react-hot-loader')
docs.devtool = 'eval'
docs.debug = true
new WebpackDevServer(webpack(docs), {
publicPath: '/' + docs.output.publicPath,
hot: true,
stats: {
cached: false,
cachedAssets: false,
colors: true,
exclude: ['node_modules', 'components'],
},
}).listen(port, 'localhost', err => {
if (err) throw new Error('webpack-dev-server', err)
console.log('[webpack-dev-server]', 'http://localhost:' + port + '/')
})