-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
55 lines (51 loc) · 1.36 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
52
53
54
55
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
/*
Info:
This project has following three different source folders.
1. src (contains simple redux implementation of createStore and reducer)
2. src_v2 (enhance version, redux implementation with combineReducers and multiple components)
3. src_v3 (enhance version, redux implementation with middlewares and async actions).
Note:
If you have made any changes to this config file then you will need to restart
your application in order to see the changes.
*/
// change this source path to src or src_v2 if you wanted to see that implementation.
const sourcePath = './src_v3';
module.exports = {
entry: `${sourcePath}/app.js`,
output: {
path: path.resolve(__dirname, 'public'),
filename: 'bundle.js',
},
devServer: {
port: 8080,
open: true,
compress: true,
contentBase: path.resolve(__dirname, 'public'),
},
devtool: 'eval-cheap-source-map',
module:{
rules:[
{
test: /\.js$/,
exclude: /node_module/,
use:{
loader: 'babel-loader',
}
},
{
test: /\.html$/,
use:{
loader: 'html-loader',
options: { minimize: true}
}
},
]
},
plugins:[
new HtmlWebpackPlugin({
template: `${sourcePath}/index.html`,
})
]
}