-
Notifications
You must be signed in to change notification settings - Fork 130
/
Copy pathwebpack.config.js
44 lines (42 loc) · 1011 Bytes
/
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
var webpack = require('webpack');
var path = require('path');
var autoprefixer = require('autoprefixer');
module.exports = {
// Start building in src folder
entry: [
'./src/index'
],
module: {
loaders: [
{
// Run js files through babel module
test: /\.js?$/, loader: 'babel', exclude: /node_modules/
},
{
// Enable SCSS functionality
test: /\.scss$/,
loaders: ["style", "css", "postcss-loader", "sass"]
}
]
},
postcss: [ autoprefixer({ browsers: ['last 2 versions'] }) ],
resolve: {
extensions: ['', '.js']
},
// Output to dist folder as bundle.js
output: {
path: path.join(__dirname, '/dist'),
publicPath: '/',
filename: 'bundle.js'
},
// Enable hot reload while webpack dev server is in use
devServer: {
contentBase: './dist',
hot: true
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
]
};