Skip to content

Commit

Permalink
build: Convert module build output to CommonJS (cjs) and ECMAScript m…
Browse files Browse the repository at this point in the history
…odule (mjs) files
  • Loading branch information
izure1 committed Apr 5, 2024
1 parent df63e50 commit 40e4a02
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
6 changes: 6 additions & 0 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@ const common = {
esbuild.build({
...common,
outdir: 'dist/esm',
outExtension: {
'.js': '.mjs'
},
bundle: true,
format: 'esm',
})

esbuild.build({
...common,
outdir: 'dist/cjs',
outExtension: {
'.js': '.cjs'
},
bundle: true,
format: 'cjs',
})
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "serializable-bptree",
"version": "3.2.4",
"version": "3.3.0",
"description": "Store the B+tree flexibly, not only in-memory.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.mjs",
"typings": "dist/typings/index.d.ts",
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.mjs",
"require": "./dist/cjs/index.cjs",
"types": "./dist/typings/index.d.ts"
}
},
Expand Down Expand Up @@ -43,6 +43,6 @@
"typescript": "^5.2.2"
},
"dependencies": {
"cachebranch": "^1.1.0"
"cachebranch": "^1.2.0"
}
}

0 comments on commit 40e4a02

Please sign in to comment.