From 95d2f5252edb616f969d90648f948d5c55a5141b Mon Sep 17 00:00:00 2001 From: Andrea Alberti Date: Sat, 19 Oct 2024 21:09:28 +0200 Subject: [PATCH] Minified production version --- esbuild.config.mjs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/esbuild.config.mjs b/esbuild.config.mjs index 549b301..c02143d 100644 --- a/esbuild.config.mjs +++ b/esbuild.config.mjs @@ -40,11 +40,18 @@ const context = await esbuild.context({ ...builtins ], format: "cjs", - target: "es2018", - logLevel: "info", - sourcemap: prod ? false : "inline", - treeShaking: true, - outdir, + target: "es2022", + logLevel: "info", + sourcemap: prod ? false : "inline", + minifySyntax: prod, // Enable syntax minification in production + minifyWhitespace: prod, // Disable whitespace minification + minifyIdentifiers: prod, // Disable identifier minification + outdir, + define: { + "process.env.NODE_ENV": JSON.stringify(prod ? "production" : "development"), + }, + minify: prod, + treeShaking: prod, plugins: [ copy({ assets: {