-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack.config.js
62 lines (60 loc) · 1.56 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
58
59
60
61
62
'use strict'
var path = require('path')
var webpack = require('webpack')
var HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
devtool: 'cheap-module-source-map',
entry: [
path.join(__dirname, 'app/main.js')
],
output: {
path: path.join(__dirname, 'dist/'),
filename: '[name].js',
publicPath: ''
},
plugins: [
new HtmlWebpackPlugin({
template: 'app/index.tpl.html',
inject: 'body',
filename: 'index.html'
}),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
})
],
module: {
loaders: [{
test: /\.js?$/,
exclude: /node_modules/,
loader: 'babel'
}, {
test: /\.json?$/,
loader: 'json'
}, {
test: /\.yml$/,
loader: 'yaml'
}, {
test: /\.css$/,
loader: 'style-loader!css-loader'
}, {
// test: /\.csv$/,
// loader: 'dsv-loader'
// }, {
test: /\.png$/,
loader: 'url-loader?limit=100000'
}, {
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'file-loader?name=./assets/img/[hash].[ext]'
},{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
// test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
// loader: 'url-loader?limit=10000&mimetype=application/font-woff&name=./assets/fonts/[hash].[ext]'
loader: 'url-loader?limit=10000&mimetype=application/font-woff&name=./assets/fonts/[hash].[ext]'
},{
test: /\.jpg$/,
loader: 'file-loader'
}]
}
}