-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.production.config.js
73 lines (70 loc) · 2.38 KB
/
webpack.production.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
62
63
64
65
66
67
68
69
70
71
72
73
var webpack = require('webpack');
var path = require('path');
var S3Plugin = require('webpack-s3-plugin')
var BUILD_DIR = path.resolve(__dirname, 'src/client/public');
var APP_DIR = path.resolve(__dirname, 'src/client/app');
var config = {
entry: {
'root': APP_DIR + '/root.jsx',
'forget': APP_DIR + '/forget.jsx',
'signin': APP_DIR + '/signin.jsx',
'signup': APP_DIR + '/signup.jsx',
'invite': APP_DIR + '/invite.jsx',
'terms': APP_DIR + '/terms.jsx',
'privacy': APP_DIR + '/privacy.jsx',
'cookies': APP_DIR + '/cookies.jsx',
'pricing': APP_DIR + '/pricing.jsx',
'p_base': APP_DIR + '/p_base.js',
'home': ['babel-polyfill',APP_DIR + '/index.jsx'],
'config': ['babel-polyfill', APP_DIR + '/config.jsx']
},
output: {
path: BUILD_DIR,
publicPath: 'https://d2kfara9vrwhb0.cloudfront.net/',
filename: '[name].js',
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: true,
screw_ie8: true,
drop_console: true
},
comments: true,
}),
new S3Plugin({
s3Options: {
region: 'eu-central-1'
},
s3UploadOptions: {
Bucket: 'kstc',
},
cloudfrontInvalidateOptions: {
DistributionId: 'ESKS7DEU7P0FX',
Items: ["/*"]
}
})
],
module : {
loaders : [
{ test: /\.json$/, loader: 'json' },
{ test: /\.md$/, loader: 'file' },
{ test: /\.jsx?/, include : APP_DIR, loader : 'babel' },
{ test: /\.css$/, exclude: /\.useable\.css$/, loader: "style-loader!css-loader" },
{ test: /\.useable\.css$/, loader: "style-loader/useable!css-loader" },
{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file" },
{ test: /\.(woff|woff2)$/, loader:"url?prefix=font/&limit=5000" },
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream" },
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml" },
{ test: /\.png(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/png" },
{ test: /\.jpg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/jpg" },
{ test: /favicon\.png$/, loader: 'file?name=[name].[ext]'},
],
},
};
module.exports = config;