-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.dev.js
38 lines (37 loc) · 1013 Bytes
/
webpack.config.dev.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
const path = require('path');
const webpack = require('webpack');
const HtmlPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
app: path.join(__dirname, 'src', 'app.js'),
vendors: ['react', 'react-dom']
},
output:{
filename: '[name].js',
path: path.join(__dirname, 'public/js/')
},
module: {
rules: [
{
test: /(\.jsx|\.js)$/,
exclude: /(node_modules|bower-components)/,
use: {
loader: 'babel-loader',
options: {
presets: ["es2015", "react"],
plugins: ["transform-es2015-modules-umd"]
}
},
},
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'vendors',
minChunks: Infinity
}),
new HtmlPlugin({
title: 'learn-webpack'
})
]
};