forked from draft-js-plugins/draft-js-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
39 lines (34 loc) · 1.25 KB
/
Copy pathwebpack.config.dev.js
File metadata and controls
39 lines (34 loc) · 1.25 KB
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
31
32
33
34
35
36
37
38
39
/* eslint-disable no-var */
var path = require('path');
var webpack = require('webpack');
var webpackBaseConfig = require('./webpack.config.base');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
// Set up dev host and HMR host. For the dev host this is pretty self
// explanatory: We use a different live-reload server to serve our static JS
// files in dev, so we need to be able to actually point a script tag to that
// host so it can load the right files. The HMR host is a bit stranger. For more
// details on why we need this URL see the readme and:
// https://github.com/glenjamin/webpack-hot-middleware/issues/37
var DEV_PORT = process.env.DEV_PORT || 3000;
var DEV_HOST = `//localhost:${DEV_PORT}/`;
var HMR_HOST = `${DEV_HOST}__webpack_hmr`;
module.exports = Object.assign(webpackBaseConfig, {
devtool: 'inline-source-map',
entry: {
app: [
`webpack-hot-middleware/client?path=${HMR_HOST}`,
'babel-polyfill',
'./client/index.js',
],
},
output: {
path: path.join(__dirname, 'public'),
filename: '[name].js',
publicPath: DEV_HOST,
},
plugins: [
new ExtractTextPlugin('css/bundle.css', { disable: true }),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
],
});