-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
40 lines (38 loc) · 1.18 KB
/
webpack.config.js
File metadata and controls
40 lines (38 loc) · 1.18 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
import { fileURLToPath } from "url";
import path from "path";
import TerserPlugin from "terser-webpack-plugin";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default {
entry: {
"nostrly-login": "./src/js/nostrly-login.ts",
"nostrly-register": "./src/js/nostrly-register.ts",
"nostrly-tools": "./src/js/nostrly-tools.ts",
"nostrly-cashu-redeem": "./src/js/nostrly-cashu-redeem.ts",
"nostrly-cashu-lock": "./src/js/nostrly-cashu-lock.ts",
"nostrly-cashu-witness": "./src/js/nostrly-cashu-witness.ts",
"nostrly-cashu-cache": "./src/js/nostrly-cashu-cache.ts",
"nostrly-cashu-gather": "./src/js/nostrly-cashu-gather.ts",
},
output: {
filename: "[name].min.js",
path: path.resolve(__dirname, "assets/js"),
},
mode: "production",
optimization: {
minimizer: [new TerserPlugin()],
},
resolve: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
modules: ["node_modules"],
},
module: {
rules: [
{
test: /\.tsx?$/, // Match .ts and .tsx files
use: "ts-loader", // Use ts-loader to compile
exclude: /node_modules/, // Skip node_modules
},
],
},
};