-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
61 lines (59 loc) · 1.53 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
const path = require("path");
const webpack = require("webpack");
const TerserPlugin = require("terser-webpack-plugin");
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
// Copyright banner text
const BANNER_TEXT = `proxyui.js is a component of the ReplayWeb.page (https://replayweb.page) system, Copyright (C) 2020-${new Date().getFullYear()}, Webrecorder Software. Licensed under the Affero General Public License v3.'`;
/** @type {import("webpack").Configuration} */
module.exports = {
target: "web",
entry: "./src/index.ts",
output: {
path: path.resolve(__dirname, "content"),
filename: `proxyui.js`,
publicPath: "/",
},
resolve: {
extensions: [".ts", ".js"],
plugins: [new TsconfigPathsPlugin()],
},
devServer: {
static: __dirname,
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: false,
}),
],
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader",
include: path.resolve(__dirname, "src"),
options: {
onlyCompileBundledFiles: true,
},
},
{
// CSS loaded as raw string and used as a CSSStyleSheet
test: /\.css$/,
type: "asset/source",
include: path.resolve(__dirname, "src"),
use: [
{
loader: "postcss-loader",
},
],
},
{
test: /\.svg$/,
type: "asset/source",
},
],
},
plugins: [new webpack.BannerPlugin(BANNER_TEXT)],
};