-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwebpack.config.js
51 lines (50 loc) · 1.16 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
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
devtool:'eval',
entry: [
'./js/index.js'
],
output:{
filename:'bundle.js',
path:__dirname + '/dist',
publicPath: 'http://localhost:8080/dist/'
},
resolve: {
root: __dirname,
extentions: ['.png','.js','.less','.scss'] /* add other extentions for webpack to look for*/
},
plugins: [
// kills the compilation upon an error.
// this keeps the outputed bundle **always** valid
new webpack.NoErrorsPlugin(),
new HtmlWebpackPlugin(
{
template:'index.html',
hash: true,
// favicon: 'favicon.ico',
}
),
],
module:{
loaders:[
{
test:/\.js?$/,
/* exclude node_modules from build process */
exclude:/node_modules/,
loaders : ['babel?presets[]=es2015,presets[]=stage-0,presets[]=react','eslint-loader'],
},
{
test: /\.less$/,
loaders: ["style", "css", "less"]
},
{
test: /\.scss$/,
loaders: ["style", "css", "sass"]
},
{test : /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
loader : 'file-loader'
}
]
}
}