-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathconfig.js
More file actions
29 lines (26 loc) · 829 Bytes
/
config.js
File metadata and controls
29 lines (26 loc) · 829 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
const nodeEnv = process.env.NODE_ENV || 'development'
const releaseBranch = process.env.RELEASE_BRANCH || 'master'
const webpackDevServerHost = process.env.DEV_HOST || 'localhost'
const webpackDevServerPort = 5050
const webpackConfig = {
webpackOutputFilename:
nodeEnv === 'production'
? '[name].[chunkhash].bundle.js'
: '[name].dev.bundle.js',
webpackPublicPath:
nodeEnv === 'production'
? '/dist/'
: `http://${webpackDevServerHost}:${webpackDevServerPort}/dist/`,
}
module.exports = Object.assign(
{
cookieSecret: process.env.COOKIE_SECRET || 'twreporter-cookie-secret',
host: process.env.HOST || 'localhost',
nodeEnv,
port: parseInt(process.env.PORT) || 3000,
releaseBranch: releaseBranch,
webpackDevServerHost,
webpackDevServerPort,
},
webpackConfig
)