-
Notifications
You must be signed in to change notification settings - Fork 59
/
webpack.config.js
61 lines (53 loc) · 1.46 KB
/
webpack.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
require('./node_modules/coffee-script/register')
const CI = process.env.CIRCLE_BRANCH
if (CI === 'master') {
process.env.ENV = 'PROD'
process.env.DOMAIN = 'topcoder.com'
process.env.NODE_ENV = 'production'
} else if (CI === 'qa-integration') {
process.env.ENV = 'QA'
process.env.DOMAIN = 'topcoder-qa.com'
process.env.NODE_ENV = 'production'
} else {
process.env.ENV = 'DEV'
process.env.DOMAIN = 'topcoder-dev.com'
process.env.NODE_ENV = 'development'
}
var accountsAppURL = null
if (process.env.ACCOUNTS_APP_URL) {
accountsAppURL = process.env.ACCOUNTS_APP_URL
}
var accountsConnectorURL = null
if (process.env.ACCOUNTS_APP_CONNECTOR_URL) {
accountsConnectorURL = process.env.ACCOUNTS_APP_CONNECTOR_URL
}
const config = require('appirio-tech-webpack-config')({
dirname: __dirname,
entry: {
app: './app/index'
},
template: './app/index.jade',
favicon: './assets/images/favicon.ico',
uglifyOptions: {
mangle: { except: ['Auth0'] }
}
})
if (process.env.ENV === 'DEV') {
config.devServer = config.devServer ? config.devServer : {}
config.devServer.proxy = [
{
path: /\/members\/.*/,
bypass: function(req, res, proxyOptions) {
return '/index.html'
}
}
]
}
if (CI) config.output.publicPath = process.env.ASSET_PREFIX
if (accountsAppURL) {
process.env.ACCOUNTS_APP_URL = accountsAppURL
}
if (accountsConnectorURL) {
process.env.ACCOUNTS_APP_CONNECTOR_URL = accountsConnectorURL
}
module.exports = config