-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.lambda.js
More file actions
60 lines (58 loc) · 1.27 KB
/
Copy pathwebpack.config.lambda.js
File metadata and controls
60 lines (58 loc) · 1.27 KB
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
var webpack = require('webpack');
var manifest = {};
try {
manifest = require('./.build/chunk-manifest.json');
} catch (e) {
console.log('Failed to read chunk manifest');
}
module.exports = {
target: 'node',
resolve: {
extensions: ['', '.js', '.jsx']
},
externals: {
'aws-sdk': 'commonjs aws-sdk'
},
plugins: [
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.DefinePlugin({
__CSS_ASSET__: JSON.stringify(manifest['app.css']),
__JS_ASSET__: JSON.stringify(manifest['app.js']),
__DEV__: false,
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
unused: true,
dead_code: true,
warnings: false,
drop_debugger: true
}
})
],
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel',
exclude: /node_modules/,
query: {
babelrc: false,
presets: ['react', 'es2015', 'stage-0']
}
},
{
test: /\.scss$/,
loader: 'ignore-loader'
},
{
test: /\.json$/,
loader: 'json-loader'
}
]
}
};