-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
47 lines (44 loc) · 960 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
45
46
47
/* eslint-disable */
'use strict';
var Webpack = require('webpack');
var path = require('path');
var nodeModulesPath = path.resolve(__dirname, 'node_modules');
var buildPath = path.resolve(__dirname, 'public', 'build');
var mainPath = path.resolve(__dirname, 'src', 'js', 'app.js');
var config = {
devtool: 'eval',
entry: [
'webpack/hot/dev-server',
'webpack-dev-server/client?http://localhost:8080',
mainPath],
output: {
filename: 'app.min.js',
path: buildPath,
publicPath: '/build/',
},
module: {
loaders: [
{
test: /\.json$/,
loader: 'json'
},
{
test: /\.css$/,
loader: 'style-loader!css-loader!postcss-loader',
},
{
test: /\.js$/,
loader: 'babel',
exclude: [nodeModulesPath],
query: {
presets: ['es2015'],
},
},
],
},
plugins: [new Webpack.HotModuleReplacementPlugin()],
postcss: function () {
return [require('autoprefixer')];
}
};
module.exports = config;