-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathwebpack.ui.config.js
46 lines (44 loc) · 1.11 KB
/
webpack.ui.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
var webpack = require('webpack');
var pkg = require('./webtask.json');
var StringReplacePlugin = require("string-replace-webpack-plugin");
module.exports = {
entry: './src/public/react/app',
output: {
filename: './dist/public/'+pkg.name+'-'+pkg.version+'.min.js'
},
module: {
loaders: [{
test: /\.jsx$/,
loader: 'jsx-loader?insertPragma=React.DOM&harmony'
}, {
test: /\metrics.jsx$/,
loader: StringReplacePlugin.replace({
replacements: [
{
pattern: /@segmentKey/ig,
replacement: function (match, p1, offset, string) {
return process.env.SEGMENT_KEY_DEV;
}.bind(this)
},
{
pattern: /@dwhEndpoint/ig,
replacement: function (match, p1, offset, string) {
return process.env.DWH_ENDPOINT_DEV;
}.bind(this)
}
]
})
}]
},
resolve: {
extensions: ['', '.js', '.jsx']
},
plugins: [
new StringReplacePlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
]
};