-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.webpack.config.js
77 lines (76 loc) · 2.15 KB
/
app.webpack.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
77
const webpack = require('webpack');
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const autoprefixer = require('autoprefixer');
module.exports = {
entry: {
home: ['./client/src/bundles/home/home.js'],
dashboard: ['./client/src/bundles/dashboard/dashboard.js'],
login: ['./client/src/bundles/login/login.js']
},
output: {
path: path.resolve('./public/bundles'),
filename: '[name].learn.hackbu.js',
chunkFilename: '[id].learn.hackbu.bundle.js'
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
presets: ['react', 'es2015', 'stage-0']
}
},
{
test: /\.scss$/,
exclude: /(node_modules|bower_components)/,
loader: ExtractTextPlugin.extract(
'style',
'css!sass!postcss'
)
},
{
test: /\.(jpg|png)$/,
exclude: /(node_modules|bower_components)/,
loader: 'file?name=[name].[hash].[ext]'
},
{
test: /\.(woff|woff2)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url?limit=10000&mimetype=application/font-woff&name=[name].[ext]'
},
{
test: /\.ttf(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url?limit=10000&mimetype=application/octet-stream&name=[name].[ext]'
},
{
test: /\.eot(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'file?name=[name].[ext]'
},
{
test: /\.svg(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url?limit=10000&mimetype=image/svg+xml&name=[name].[ext]'
}
]
},
resolve: {
root: path.resolve('./client/src'),
modulesDirectories: ['node_modules', 'bower_components']
},
plugins: [
new webpack.DllReferencePlugin({
context: '.',
manifest: require('./public/bundles/vendor.json')
}),
new ExtractTextPlugin('[name].learn.hackbu.css'),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
mangle: false
})
],
postcss: [ autoprefixer({ browsers: ['last 2 versions'] }) ]
};