-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.production.config.js
77 lines (74 loc) · 2.3 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
74
75
76
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var srcDiir = path.join(__dirname, 'src')
module.exports = {
entry: [
'./src/index.js',
'bootstrap-sass!./bootstrap-sass.config.js'
],
output: {
path: path.join(__dirname, 'build'),
filename: 'bundle.min.js'
},
resolve: { root: [path.join(__dirname, 'bower_components')] },
plugins: [
new webpack.ResolverPlugin(new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('bower.json', ['main'])),
new ExtractTextPlugin('styles.css', { allChunks: true }),
new webpack.ProvidePlugin({
m: 'mithril'
}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(true),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
mangle: false,
compress: { warnings: false }
})
],
module: {
loaders: [
{
test: /\.js?$/,
loader: 'babel',
exclude: /(node_modules|bower_components)/
},
{
test: /\.html$/,
loader: 'static'
},
{
test: /\.(png|jpg|gif)$/,
loader: 'file?name=[name].[ext]'
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
},
{
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&mimetype=application/font-woff'
},
{
test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&mimetype=application/font-woff'
},
{
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&mimetype=application/octet-stream'
},
{
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
loader: 'file'
},
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: 'file?name=[name].[ext]'
},
{
test: /bootstrap-sass\/assets\/javascripts\//,
loader: 'imports'
}
]
}
};