Skip to content

Commit

Permalink
feat: make esm the default format and export a separate cjs file
Browse files Browse the repository at this point in the history
BREAKING CHANGE
  • Loading branch information
igor-ribeiro committed Feb 27, 2024
1 parent 2fc3b27 commit db0c1ad
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const browser = {
build({
...config,
outfile: "./dist/index.js",
format: "cjs",
format: "esm",
}).catch(exit);

build({
Expand All @@ -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);

0 comments on commit db0c1ad

Please sign in to comment.