-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathdev.js
More file actions
40 lines (35 loc) · 1013 Bytes
/
dev.js
File metadata and controls
40 lines (35 loc) · 1013 Bytes
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
40
'use strict';
let path = require('path');
let webpack = require('webpack');
let baseConfig = require('./base');
let defaultSettings = require('./defaults');
// Add needed plugins here
let config = Object.assign({}, baseConfig.pureConfig, {
mode: 'development',
entry: [
'webpack-dev-server/client?http://127.0.0.1:' + defaultSettings.port,
'webpack/hot/only-dev-server',
'./src/index'
],
cache: true,
devtool: 'eval-source-map',
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.LoaderOptionsPlugin({ options: {} }),
new webpack.NoEmitOnErrorsPlugin(),
],
module: defaultSettings.getDefaultModules()
});
// Add needed rules (loaders in Webpack 1.x) to the defaults here
config.module.rules.push({
test: /\.(js|jsx)$/,
loader: 'react-hot-loader/webpack!babel-loader',
include: [].concat(
baseConfig.extras.additionalPaths,
[ path.join(__dirname, '/../src') ]
)
});
module.exports = {
pureConfig: config,
extras: baseConfig.extras,
};