From b0814b1b97d9275b01a97d6fa946529811a22720 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sat, 15 Mar 2025 14:11:05 +0000 Subject: [PATCH] Improve bundling --- frontend/sync-client/webpack.config.js | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/frontend/sync-client/webpack.config.js b/frontend/sync-client/webpack.config.js index cd2c051d..6d03f510 100644 --- a/frontend/sync-client/webpack.config.js +++ b/frontend/sync-client/webpack.config.js @@ -2,24 +2,11 @@ const path = require("path"); module.exports = (_env, _argv) => ({ entry: "./src/index.ts", - devtool: "source-map", - target: "node", module: { rules: [ { test: /\.ts$/, - use: [ - { - loader: "ts-loader", - options: { - compilerOptions: { - declaration: true, - declarationDir: "./dist/types" - }, - transpileOnly: false - } - } - ] + use: ["ts-loader"] }, { test: /\.wasm$/, @@ -28,18 +15,23 @@ module.exports = (_env, _argv) => ({ ] }, optimization: { + // the consuming project should take care of minification minimize: false }, resolve: { - extensions: [".ts", ".js"], + extensions: [".ts"], alias: { root: __dirname, src: path.resolve(__dirname, "src") } }, + performance: { + hints: false // it's a library, no need to warn about its size + }, output: { clean: true, filename: "index.js", + globalObject: "this", library: { name: "SyncClient", type: "umd"