-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
46 lines (37 loc) · 1.4 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
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
module.exports = {
entry: [
'./develop/app.js',
],
output: {
path: path.join(__dirname, '/public/static/build/'),
filename: 'main.js',
publicPath: 'static/build/'
},
module: {
loaders: [
{ test: /\.css$/, loader: 'style!css' },
{ test: /\.gif$/, loader: 'url?limit=500000&mimetype=/image/gif' },
{ test: /\.jpg$/, loader: 'url?limit=500000&mimetype=/image/jpg' },
{ test: /\.png$/, loader: 'url?limit=500000&mimetype=/image/png' },
{ test: /\.svg/, loader: 'url?limit=500000&mimetype=/image/svg+xml' },
// {
// test: /.*\.(gif|png|jpe?g|svg)$/i,
// loaders: ['file?hash=sha512&digest=hex&name=[hash].[ext]', 'image-webpack'],
// },
{ test: /\.(woff|woff2|ttf|eot)/, loader: 'url?limit=500000' },
{ test: /\.jsx$/, loader: 'react-hot!babel', exclude: [/node_modules/, /public/] },
{ test: /\.js$/, loader: 'babel', exclude: [/node_modules/, /public/] },
{ test: /\.json$/, loader: 'json' },
],
},
plugins: [
new HtmlWebpackPlugin({
filename: '../../index.html',
template: 'develop/index.html',
inject: 'body',
hash: true,
}),
],
};