-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
57 lines (54 loc) · 1.38 KB
/
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
'use strict';
var path = require("path");
var webpack = require("webpack");
let srcPath = path.join(__dirname, '/source');
let publicPath = '/assets/';
module.exports = {
cache: true,
entry: path.join(__dirname, '/source/index'),
output: {
path: path.join(__dirname, '/dist/assets'),
filename: 'index.min.js',
publicPath: publicPath
},
module: {
loaders: [
{
test: /\.(js|jsx)$/,
exclude: /(node_modules)/,
loader: 'react-hot!babel-loader'
// 'babel-loader' is also a legal name to reference
//query: {
//presets: ['es2015','stage-0', 'react']
//}
},
{
test: /\.(png|jpg|gif|woff|woff2)$/,
loader: 'url-loader?limit=8192'
},
]
},
resolve: {
extensions: ['', '.js', '.jsx'],
alias: {
css: srcPath + '/css/',
js: srcPath + '/js/',
lib: srcPath + '/lib/',
components: srcPath + '/components/'
}
},
plugins: [
new webpack.ProvidePlugin({
// Automtically detect jQuery and $ as free var in modules
// and inject the jquery library
// This is required by many jquery plugins
$: "jquery",
jQuery: "jquery"
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
]
};