From 5574ebeff503dac6b9a0476859fb0d22765f32e4 Mon Sep 17 00:00:00 2001 From: Nikhil Saraf Date: Sat, 30 Dec 2023 10:44:47 +0530 Subject: [PATCH 1/2] feat: add process.env.MINIFY support for build, add preserveEntrySignatures fix (fixes [Issue] Plugin is not working #44) --- packages/vinxi/lib/build.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/vinxi/lib/build.js b/packages/vinxi/lib/build.js index 76e9432a..d77f6850 100644 --- a/packages/vinxi/lib/build.js +++ b/packages/vinxi/lib/build.js @@ -96,6 +96,8 @@ export async function createBuild(app, buildConfig) { // externals: { // inline: ["node-fetch-native/polyfill"], // }, + + minify: process.env.MINIFY !== "false" ?? true, plugins: [ "#vinxi/prod-app", fileURLToPath(new URL("./app-fetch.js", import.meta.url)), @@ -662,8 +664,10 @@ function handerBuild() { ...builtinModules.map((m) => `node:${m}`), ], treeshake: true, + preserveEntrySignatures: "exports-only", }, ssr: true, + minify: process.env.MINIFY !== "false" ?? true, manifest: true, target: "node18", ssrEmitAssets: true, @@ -694,7 +698,9 @@ function browserBuild() { rollupOptions: { input: await getEntries(router), treeshake: true, + preserveEntrySignatures: "exports-only", }, + minify: process.env.MINIFY !== "false" ?? true, manifest: true, outDir: join(router.outDir, router.base), target: "esnext", From 1261c16512cb4f3819c7fb86774534e2582ab253 Mon Sep 17 00:00:00 2001 From: Nikhil Saraf Date: Sat, 30 Dec 2023 10:47:00 +0530 Subject: [PATCH 2/2] Create silent-bottles-reflect.md --- .changeset/silent-bottles-reflect.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/silent-bottles-reflect.md diff --git a/.changeset/silent-bottles-reflect.md b/.changeset/silent-bottles-reflect.md new file mode 100644 index 00000000..36344c40 --- /dev/null +++ b/.changeset/silent-bottles-reflect.md @@ -0,0 +1,5 @@ +--- +"vinxi": patch +--- + +feat: add process.env.MINIFY support for build, add preserveEntrySignatures fix (fixes [Issue] Plugin is not working #44)