forked from steemit/condenser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev.config.js
69 lines (67 loc) · 2.17 KB
/
dev.config.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import webpack from 'webpack';
import git from 'git-rev-sync';
import { isArray } from 'lodash';
import baseConfig from './base.config';
import startKoa from './utils/start-koa';
const LOCAL_IP = require('dev-ip')();
const WEBPACK_PORT = process.env.PORT ? parseInt(process.env.PORT)+1 : 8081;
const HOST = (isArray(LOCAL_IP) && LOCAL_IP[0]) || LOCAL_IP || 'localhost';
const PUBLIC_PATH = "/assets/";
export default {
server: {
port: WEBPACK_PORT,
options: {
publicPath: PUBLIC_PATH,
hot: true,
stats: {
assets: true,
colors: true,
version: false,
hash: false,
timings: true,
chunks: false,
chunkModules: false
}
}
},
webpack: {
...baseConfig,
devtool: 'source-map',
entry: {
app: [
'./app/Main.js',
//`webpack-hot-middleware/client?path=//${HOST}:${PORT}/__webpack_hmr`,
]
},
output: {...baseConfig.output, publicPath: PUBLIC_PATH},
module: {
...baseConfig.module,
loaders: [
...baseConfig.module.loaders,
]
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
'process.env': {
BROWSER: JSON.stringify(true),
NODE_ENV: JSON.stringify('development'),
VERSION: JSON.stringify(git.tag())
},
global: {
'TYPED_ARRAY_SUPPORT': JSON.stringify(false)
}
}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'),
...baseConfig.plugins,
function () {
console.log("Please wait for app server startup (~60s)" +
" after webpack server startup...");
this.plugin('done', startKoa);
}
]
}
};