Skip to content

Commit

Permalink
fix(esbuild): fix emitted formats
Browse files Browse the repository at this point in the history
  • Loading branch information
imbhargav5 committed May 2, 2021
1 parent 7450f32 commit e06ee0d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
19 changes: 17 additions & 2 deletions esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,30 @@ const build = async ({ outfile, format, minify = false, globalName, ...rest }) =

build({
entryPoints: [new URL("src/index.ts", import.meta.url).pathname],
outfile: new URL("rooks.js", lib),
outfile: new URL("rooks.umd.js", lib),
format: "umd",
globalName: "Rooks",
});

build({
entryPoints: [new URL("src/index.ts", import.meta.url).pathname],
outfile: new URL("rooks.min.js", lib),
outfile: new URL("rooks.umd.min.js", lib),
format: "umd",
minify: true,
globalName: "Rooks",
});

build({
entryPoints: [new URL("src/index.ts", import.meta.url).pathname],
outfile: new URL("rooks.js", lib),
format: "cjs",
globalName: "Rooks",
});

build({
entryPoints: [new URL("src/index.ts", import.meta.url).pathname],
outfile: new URL("rooks.min.js", lib),
format: "cjs",
minify: true,
globalName: "Rooks",
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "5.0.0",
"description": "Useful React hooks for everyone.",
"main": "lib/rooks.js",
"jsnext:main": "lib/rooks.esm.js",
"module": "lib/rooks.esm.js",
"unpkg": "lib/rooks.umd.js",
"types": "lib/types/index.d.ts",
"scripts": {
"clean": "rimraf dist lib",
Expand Down

0 comments on commit e06ee0d

Please sign in to comment.