-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.js
More file actions
50 lines (48 loc) · 1.97 KB
/
Copy pathwebpack.config.js
File metadata and controls
50 lines (48 loc) · 1.97 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
var webpack = require('webpack');
var path = require('path');
var CompressionPlugin = require("compression-webpack-plugin");
module.exports = {
entry: {
bundle : path.join(__dirname, '/public/js/application.js'),
postShow : path.join(__dirname, '/public/js/postShow.js'),
systemStatus : path.join(__dirname, '/public/js/systemStatus.js'),
embed : path.join(__dirname, '/public/js/embed')
},
output: {
path: path.join(__dirname, './public/dist'),
filename: '[name].js',
sourceMap : '[file].map'
},
resolve: {
// you can now require('file') instead of require('file.js')
extensions: ['', '.js', '.json', '.less']
},
module: {
loaders: [
{ test: /\.css$/, loader: 'style-loader!css-loader!autoprefixer-loader?browsers=last 2 version' },
{ test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&minetype=application/font-woff" },
{ test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&minetype=application/font-woff" },
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&minetype=application/octet-stream" },
{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file" },
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&minetype=image/svg+xml" },
{ test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192'}, // inline base64 URLs for <=8k images, direct URLs for the rest
{ test: /\.less$/, loader: "style-loader!css-loader!autoprefixer-loader?browsers=last 2 version!less-loader"},
{ test : /\.js$/, loader : 'jsx-transform-loader'}
]
},
plugins: [
new CompressionPlugin({
asset: "{file}.gz",
algorithm: "gzip",
regExp: /\.js$|\.html$/,
threshold: 10240,
minRatio: 0.8
})
],
resolve: {
alias: {
jquery: path.join(__dirname, "/public/js/vendor/jquery-2.0.3.js" ),
validate: path.join(__dirname, "/public/js/vendor/validate.js" )
}
}
};