Skip to content

Commit f0c7589

Browse files
authored
Merge pull request #68 from badgateway/cjs-build
Bundling CJS in npm build
2 parents acac73a + 4f396a7 commit f0c7589

File tree

5 files changed

+1788
-11
lines changed

5 files changed

+1788
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010

1111
# build
1212
/dist
13+
/cjs
1314
/browser

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
SOURCE_FILES:=$(shell find src/ -type f -name '*.ts')
22

33
.PHONY: build
4-
build: dist/build
4+
build: dist/build cjs/index.cjs
55

66
.PHONY: clean
77
clean:
8-
rm -r dist/
8+
rm -r dist/ cjs/
99

1010
.PHONY: test
1111
test: lint test/httpwg-tests/list.json dist/build
@@ -32,5 +32,9 @@ dist/build: $(SOURCE_FILES)
3232
@# A fake file to keep track of the last build time
3333
touch dist/build
3434

35+
cjs/index.cjs: ${SOURCE_FILES}
36+
mkdir -p cjs
37+
npx tsup -d cjs --format cjs src/index.ts --dts --sourcemap
38+
3539
test/httpwg-tests/list.json:
3640
git clone https://github.com/httpwg/structured-header-tests test/httpwg-tests

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ ChangeLog
66

77
* #66: We now convert from/to ArrayBuffer instead of a custom ByteSequence
88
object. This is a breaking change.
9+
* Bundling CommonJS for backwards compat.
910

1011

1112
2.0.0-alpha.1 (2024-02-23)

0 commit comments

Comments
 (0)