-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
42 lines (39 loc) · 882 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
'use strict';
var webpack = require('webpack'),
HtmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path'),
srcPath = path.join(__dirname, './src'),
buildPath = './build',
appModule = 'app.js';
module.exports = {
target: 'web',
entry: {
app: [ path.join(srcPath, appModule) ],
},
output: {
path: path.join(__dirname, buildPath),
publicPath: '/',
filename: '[name].js'
},
resolve: {
root: srcPath,
extensions: ['', '.js'],
modulesDirectories: ['node_modules', 'src']
},
module: {
loaders: [{
test: /\.jsx?$/,
exclude: /node_modules/,
loaders: ['babel']
}]
},
plugins: [
new HtmlWebpackPlugin({
inject: true,
template: srcPath + '/index.html'
}),
new webpack.NoErrorsPlugin()
],
debug: true,
devtool: 'module-source-map'
};