Improve bundling

This commit is contained in:
Andras Schmelczer 2025-03-15 14:11:05 +00:00
commit b0814b1b97
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C

View file

@ -2,24 +2,11 @@ const path = require("path");
module.exports = (_env, _argv) => ({ module.exports = (_env, _argv) => ({
entry: "./src/index.ts", entry: "./src/index.ts",
devtool: "source-map",
target: "node",
module: { module: {
rules: [ rules: [
{ {
test: /\.ts$/, test: /\.ts$/,
use: [ use: ["ts-loader"]
{
loader: "ts-loader",
options: {
compilerOptions: {
declaration: true,
declarationDir: "./dist/types"
},
transpileOnly: false
}
}
]
}, },
{ {
test: /\.wasm$/, test: /\.wasm$/,
@ -28,18 +15,23 @@ module.exports = (_env, _argv) => ({
] ]
}, },
optimization: { optimization: {
// the consuming project should take care of minification
minimize: false minimize: false
}, },
resolve: { resolve: {
extensions: [".ts", ".js"], extensions: [".ts"],
alias: { alias: {
root: __dirname, root: __dirname,
src: path.resolve(__dirname, "src") src: path.resolve(__dirname, "src")
} }
}, },
performance: {
hints: false // it's a library, no need to warn about its size
},
output: { output: {
clean: true, clean: true,
filename: "index.js", filename: "index.js",
globalObject: "this",
library: { library: {
name: "SyncClient", name: "SyncClient",
type: "umd" type: "umd"