-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
85 lines (83 loc) · 1.82 KB
/
webpack.config.js
File metadata and controls
85 lines (83 loc) · 1.82 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
const HtmlWebPackPlugin = require("html-webpack-plugin");
var webpack = require('webpack');
var path = require('path');
module.exports = {
entry: {
main: './src/index.js',
forgotten_password: './src/forgotten-password.js',
reset_password: './src/reset-password.js',
my_profile: './src/my-profile.js'
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test: /\.(png|jpe?g|gif)$/i,
use: [
{
loader: 'file-loader',
},
],
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
},
{
test: /\.html$/,
use: [
{
loader: "html-loader"
}
]
}
]
},
devServer: {
port: 8080,
compress: true, //compresses what's server into gzip
hot:true, //hot reloading
http2: true, //using https
proxy: {
'/': {
target: 'https://localhost:3000',
pathRewrite: {'^/api' : ''},
secure: false
}
}
},
plugins: [
// new webpack.ProvidePlugin({
// $: "jquery",
// }),
new HtmlWebPackPlugin({
template: "./public/reset-password.html",
filename: "./reset-password.html",
chunks: ['reset_password']
}),
new HtmlWebPackPlugin({
template: "./public/welcome.html",
filename: "./welcome.html",
chunks: ['main']
}),
new HtmlWebPackPlugin({
template: "./public/forgotten-password.html",
filename: "./forgotten-password.html",
chunks: ['forgotten_password']
}),
new HtmlWebPackPlugin({
template: "./public/my-profile.html",
filename: "./my-profile.html",
chunks: ['my_profile']
})
]
};