forked from vincentriemer/io-808
-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.prod.js
executable file
·86 lines (85 loc) · 2.12 KB
/
webpack.config.prod.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
74
75
76
77
78
79
80
81
82
83
84
85
86
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var FaviconsWebpackPlugin = require('favicons-webpack-plugin');
var OfflinePlugin = require('offline-plugin');
module.exports = {
devtool: 'source-map',
entry: [
'core-js/es6/symbol',
'core-js/es6/reflect',
'core-js/fn/array/includes',
'./src/index'
],
output: {
path: path.join(__dirname, 'out'),
filename: 'bundle.js',
publicPath: ''
},
module: {
loaders: [
{ test: /\.jade$/, loader: 'jade' },
{ test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader!postcss-loader') },
{ test: /\.js$/, loaders: ['babel'], include: path.join(__dirname, 'src') },
{ test: /\.(otf|eot|svg|ttf|woff|woff2).*$/, loader: 'url?limit=8192' }
]
},
postcss: [
require('autoprefixer')
],
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false
}
}),
new FaviconsWebpackPlugin({
logo: './base-favicon.png',
inject: true,
background: '#363830',
title: 'iO-808',
icons: {
android: true,
appleIcon: true,
appleStartup: true,
coast: false,
favicons: true,
firefox: true,
opengraph: false,
twitter: true,
yandex: false,
windows: true
}
}),
new HtmlWebpackPlugin({
inject: false,
cache: false,
minify: {
collapseWhitespace: true,
html5: true,
minifyCSS: true,
minifyJS: true,
removeComments: true,
useShortDoctype: true
},
template: 'src/index.jade',
filename: 'index.html',
title: 'iO-808'
}),
new ExtractTextPlugin('styles.css'),
new OfflinePlugin()
],
resolve: {
root: [
path.resolve('./node_modules'),
path.resolve('./src')
]
}
};