-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebapp.config.js
62 lines (61 loc) · 1.79 KB
/
webapp.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
const path = require("path");
const CleanupPlugin = require("webpack-cleanup-plugin");
const HtmlWebPackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
target: "web",
entry: [
path.resolve(__dirname, "./src/webapp/public/js/index.js")
],
output: {
path: path.resolve(__dirname, "./dist/webapp/public"),
filename: "js/bundle.[chunkhash].js",
publicPath: ""
},
resolve: {
extensions: [ ".web.js", ".js", ".scss" ],
alias: {
"d8s/infrastructure/logging$": path.resolve(__dirname, "./src/infrastructure/logging/index.js"),
"d8s/infrastructure/util$": path.resolve(__dirname, "./src/infrastructure/util/index.web.js"),
"d8s/infrastructure/dependency-injection$": path.resolve(__dirname, "./src/infrastructure/dependency-injection/index.js"),
"d8s/infrastructure/cryptography$": path.resolve(__dirname, "./src/infrastructure/cryptography/index.web.js")
}
},
module: {
rules: [{
test: /\.js$/,
exclude: /node_modules/,
use: [
"babel-loader",
"eslint-loader"
]
}, {
test: /\.scss$/,
exclude: /node_modules/,
use: [
"style-loader",
{
loader: MiniCssExtractPlugin.loader
},
"css-loader",
"sass-loader"
]
}]
},
plugins: [
new CleanupPlugin(),
new MiniCssExtractPlugin({
filename: "css/style.[chunkhash].css"
}),
new HtmlWebPackPlugin({
template: path.resolve(__dirname, "./src/webapp/public/index.html"),
filename: path.resolve(__dirname, "./dist/webapp/public/index.html")
})
],
devtool: "source-map",
devServer: {
contentBase: path.join(__dirname, "./dist/webapp/public"),
compress: true,
port: 9789
}
};