From db0c1ad214ecf475daf18606fab4eaaa4603dd22 Mon Sep 17 00:00:00 2001 From: Igor Ribeiro Date: Mon, 26 Feb 2024 22:11:58 -0300 Subject: [PATCH] feat: make esm the default format and export a separate cjs file BREAKING CHANGE --- scripts/build.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/build.js b/scripts/build.js index f7cc0d0..05b88ce 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -19,7 +19,7 @@ const browser = { build({ ...config, outfile: "./dist/index.js", - format: "cjs", + format: "esm", }).catch(exit); build({ @@ -31,22 +31,22 @@ build({ build({ ...browser, - outfile: "./dist/index.mjs", - format: "esm", + outfile: "./dist/index.cjs", + format: "cjs", }).catch(exit); build({ ...config, entryPoints: ["./src/react/index.ts"], outfile: "./dist/react/index.js", - format: "cjs", + format: "esm", external: ["react", "."], }).catch(exit); build({ ...config, entryPoints: ["./src/react/index.ts"], - outfile: "./dist/react/index.mjs", - format: "esm", + outfile: "./dist/react/index.cjs", + format: "cjs", external: ["react", "."], }).catch(exit);