Skip to content

Commit

Permalink
Merge pull request #223 from FelipeSilva916/add-cjs-build
Browse files Browse the repository at this point in the history
Add CommonJS build script
  • Loading branch information
jgerigmeyer authored Oct 8, 2024
2 parents b8b3ad4 + 9741e9e commit e93b631
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"popover"
],
"type": "module",
"main": "./dist/popover-fn.js",
"main": "./dist/popover.js",
"module": "./dist/popover.js",
"browser": "./dist/popover.iife.min.js",
"unpkg": "./dist/popover.min.js",
Expand All @@ -33,7 +33,8 @@
},
"./fn": {
"types": "./dist/index-fn.d.ts",
"import": "./dist/popover-fn.js"
"import": "./dist/popover-fn.js",
"require": "./dist/popover-fn.cjs.js"
}
},
"typesVersions": {
Expand All @@ -60,6 +61,7 @@
"build:esm": "esbuild --bundle src/index.ts --outfile=dist/popover.js --format=esm --sourcemap",
"build:esm-min": "esbuild --bundle src/index.ts --outfile=dist/popover.min.js --format=esm --minify --sourcemap",
"build:esm-fn": "esbuild --bundle src/index-fn.ts --outfile=dist/popover-fn.js --format=esm --sourcemap",
"build:cjs-fn": "esbuild --bundle src/index-fn.ts --outfile=dist/popover-fn.cjs.js --format=cjs --sourcemap",
"clean": "rm -rf dist",
"build": "run-s clean build:* types",
"server:start": "esbuild --bundle src/index.ts --format=esm --servedir=. --outdir=dist --sourcemap --serve=\"${PORT:-3000}\" --log-level=\"${LEVEL:-info}\"",
Expand Down

0 comments on commit e93b631

Please sign in to comment.