-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
82 lines (81 loc) · 1.99 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
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
const HtmlWebpackPlugin = require("html-webpack-plugin")
const MiniCssExtractPlugin = require("mini-css-extract-plugin")
module.exports = {
// https://webpack.js.org/concepts/entry-points/#multi-page-application
entry: {
index: './sampuru-ui/src/index.ts',
project: './sampuru-ui/src/project.ts',
qcables: './sampuru-ui/src/qcables.ts',
cases: './sampuru-ui/src/cases.ts'
},
mode: "development",
// https://webpack.js.org/configuration/dev-server/
devServer: {
open: true,
host: 'local-ip',
port: 8080,
proxy: {
'/api': {
target: 'http://localhost:8088',
secure: false,
changeOrigin: true
}
},
headers: {
"Access-Control-Allow-Origin": "*",
}
},
// https://webpack.js.org/concepts/loaders/
module: {
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
exclude: /node_modules/
},
{
test: /\.css$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: "css-loader"
}
]
}
]
},
resolve: {
extensions: ['.js', '.ts']
},
// https://webpack.js.org/concepts/plugins/
plugins: [
new HtmlWebpackPlugin({
template: "sampuru-server/src/main/resources/static/index.html",
inject: false,
chunks: ['index'],
filename: "index.html"
}),
new HtmlWebpackPlugin({
template: "sampuru-server/src/main/resources/static/project.html",
inject: false,
chunks: ['project'],
filename: "project.html"
}),
new HtmlWebpackPlugin({
template: "sampuru-server/src/main/resources/static/qcables.html",
inject: false,
chunks: ['qcables'],
filename: "qcables.html"
}),
new HtmlWebpackPlugin({
template: "sampuru-server/src/main/resources/static/cases.html",
inject: false,
chunks: ['cases'],
filename: "cases.html"
}),
new MiniCssExtractPlugin({
filename: 'main.css',
chunkFilename: "[id].css"
})
]
}