2017-03-03 01:44:07 +00:00
|
|
|
const webpack = require('webpack');
|
|
|
|
const baseConfig = require('./webpack.config.base.babel');
|
2017-11-24 01:39:53 +00:00
|
|
|
const pkg = require('../package.json');
|
2016-04-20 02:14:53 +00:00
|
|
|
|
2017-11-26 20:45:40 +00:00
|
|
|
const PORT = pkg.dev['dev-server-port'];
|
2016-10-21 17:20:36 +00:00
|
|
|
|
2017-03-03 01:44:07 +00:00
|
|
|
module.exports = {
|
2016-04-20 02:14:53 +00:00
|
|
|
...baseConfig,
|
2017-02-26 21:12:51 +00:00
|
|
|
devtool: 'eval-source-map',
|
2018-04-18 18:20:49 +00:00
|
|
|
mode: 'development',
|
2016-04-20 02:14:53 +00:00
|
|
|
entry: [
|
2017-03-03 01:44:07 +00:00
|
|
|
'react-hot-loader/patch',
|
2017-11-26 20:45:40 +00:00
|
|
|
`webpack-dev-server/client?http://localhost:${PORT}`,
|
2017-11-24 01:39:53 +00:00
|
|
|
'webpack/hot/only-dev-server',
|
2017-03-03 20:09:08 +00:00
|
|
|
...baseConfig.entry
|
2016-04-20 02:14:53 +00:00
|
|
|
],
|
|
|
|
output: {
|
|
|
|
...baseConfig.output,
|
2017-11-24 01:39:53 +00:00
|
|
|
publicPath: '/'
|
2017-03-03 01:44:07 +00:00
|
|
|
},
|
|
|
|
devServer: {
|
2017-11-24 01:39:53 +00:00
|
|
|
host: 'localhost',
|
2017-11-26 20:45:40 +00:00
|
|
|
port: PORT,
|
2017-11-24 01:39:53 +00:00
|
|
|
publicPath: '/',
|
|
|
|
hot: true
|
2016-04-20 02:14:53 +00:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
...baseConfig.plugins,
|
2017-03-03 01:44:07 +00:00
|
|
|
new webpack.LoaderOptionsPlugin({debug: true}), // Legacy global loader option
|
2016-04-20 02:14:53 +00:00
|
|
|
new webpack.HotModuleReplacementPlugin(),
|
2017-02-26 21:12:51 +00:00
|
|
|
new webpack.NoEmitOnErrorsPlugin(),
|
2017-03-03 01:44:07 +00:00
|
|
|
new webpack.NamedModulesPlugin(),
|
2016-04-20 02:14:53 +00:00
|
|
|
new webpack.DefinePlugin({
|
|
|
|
__DEV__: true,
|
2016-08-17 22:44:03 +00:00
|
|
|
'process.env.NODE_ENV': JSON.stringify('development'),
|
|
|
|
'process.env.INSOMNIA_ENV': JSON.stringify('development')
|
2016-04-20 02:14:53 +00:00
|
|
|
})
|
|
|
|
]
|
2017-03-03 01:44:07 +00:00
|
|
|
};
|