1 | require('./node_modules/coffee-script/register')
|
2 |
|
3 | const branch = process.env.TRAVIS_BRANCH
|
4 |
|
5 | if (branch === 'master') process.env.ENV = 'PROD'
|
6 | if (branch === 'dev') process.env.ENV = 'DEV'
|
7 | if (branch === 'qa') process.env.ENV = 'QA'
|
8 |
|
9 | const config = require('appirio-tech-webpack-config')({
|
10 | dirname: __dirname,
|
11 | entry: {
|
12 | app: ['./src/index']
|
13 | },
|
14 | template: './src/index.html',
|
15 | browserUrl: 'http://localhost:3000/search/members?q=java'
|
16 | })
|
17 |
|
18 |
|
19 |
|
20 | if (branch === 'dev') config.output.publicPath = '//d2w5g0u9h79yyx.cloudfront.net/'
|
21 | if (branch === 'qa') config.output.publicPath = '//changeme.cloudfront.net/'
|
22 | if (branch === 'master') config.output.publicPath = '//changeme.cloudfront.net/'
|
23 |
|
24 |
|
25 | const babelOptions = {
|
26 | presets: [ 'es2015', 'react', 'stage-2' ],
|
27 | plugins: [ 'lodash' ]
|
28 | }
|
29 |
|
30 | const jsxLoader = {
|
31 | test: /\.(js|jsx)$/,
|
32 | loaders: [
|
33 | 'react-hot',
|
34 | 'babel?' + JSON.stringify(babelOptions)
|
35 | ],
|
36 | exclude: /node_modules\/(?!appirio-tech.*)/
|
37 | }
|
38 |
|
39 |
|
40 | config.module.loaders.forEach((loader, i, loaders) => {
|
41 | if (loader.loader === 'babel' && String(loader.test) === String(/\.(js|jsx)$/)) {
|
42 | jsxLoader.include = loader.include
|
43 | loaders[i] = jsxLoader
|
44 | }
|
45 | })
|
46 |
|
47 | module.exports = config
|