Skip to content

Commit

Permalink
Feat : Support browser & node
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoit-Welsch committed Apr 30, 2024
1 parent 6a49148 commit 87c5c03
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ jobs:
- name: Test
run: bun test

- name: Build
- name: Build (Bun)
run: bun run build

- name: Build (node)
run: npm run build:node

- name: Build (browser)
run: npm run build:browser

- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Binary file modified bun.lockb
Binary file not shown.
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"type": "module",
"scripts": {
"build": "bun build.mjs && bun build src/index.ts --outfile=dist/index.js --target=bun --minify",
"build:node": "bun build.mjs && bun build src/index.ts --outfile=dist/node.js --target=node --minify",
"build:browser": "bun build.mjs && bun build src/index.ts --outfile=dist/browser.js --target=browser --minify",
"build:all": "bun run build:node && bun run build:browser && bun run build",
"doc": "bun genDoc.ts",
"format": "prettier --write \"src/**/*.ts\" --single-quote --trailing-comma all --tab-width 2",
"format:md": "prettier --write \"**/*.md\" --single-quote --trailing-comma all --tab-width 2",
Expand All @@ -25,10 +28,18 @@
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./nodejs": {
"types": "./dist/index.d.ts",
"default": "./dist/node.js"
},
"./web": {
"types": "./dist/index.d.ts",
"default": "./dist/browser.js"
}
},
"license": "MIT",
"dependencies": {
"lodash.mergewith": "^4.6.2"
}
}
}

0 comments on commit 87c5c03

Please sign in to comment.