-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
42 lines (34 loc) · 1.19 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
var HtmlwebpackPlugin = require('html-webpack-plugin');
var OpenBrowserPlugin = require('open-browser-webpack-plugin');
module.exports = {
entry: './src/index.js',
output: {
filename: 'build/bundle.js',
publicPath: 'public'
},
module: {
loaders: [
{ test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader?presets[]=es2015&presets[]=react',
},
{ test: /\.css$/, loader: 'style-loader!css-loader'},
{ test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192'},
// { test: /\.css$/, loader: 'style!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]' },
{ test: /\.woff$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff'},
{ test: /\.ttf$/, loader: 'url-loader?limit=10000&mimetype=application/octet-streasm'},
{ test: /\.eot$/, loader: 'file-loader'},
{ test: /\.json$/, loader: 'json-loader'},
{ test: /\.svg$/, loader: 'url-loader?limit=10000&mimetype=image/svg+xml'}
]
},
plugins: [
new HtmlwebpackPlugin({
title: 'webpack-demos',
filename: 'index.html'
}),
new OpenBrowserPlugin({
url: 'http://127.0.0.1:8080'
})
],
}