Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(*): correct packages type for commonjs build #14

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@
!/pkg/*/pnpm-lock.yaml
!/pkg/*/tsconfig.json
!/pkg/*/.npmignore

# build script
!/fixup.sh
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
!/build/cjs/src/**/*.js
!/build/cjs/src/**/*.js.map
!/build/cjs/src/**/*.d.ts
!/build/cjs/package.json
9 changes: 9 additions & 0 deletions fixup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/env bash

for f in pkg/*; do
cat <<EOF > ${f}/build/cjs/package.json
{
"type": "commonjs"
}
EOF
done
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"clean": "rm -rf .coverage && pnpm -F @slangroom/* exec -- rm -rf build",
"build": "pnpm build:esm",
"build:dual": "pnpm build:esm && pnpm build:cjs",
"build:cjs": "pnpm -F @slangroom/* exec tsc --outDir build/cjs --module commonjs",
"build:cjs": "pnpm -F @slangroom/* exec tsc --outDir build/cjs --module commonjs && ./fixup.sh",
"build:esm": "pnpm -F @slangroom/* exec tsc --outdir build/esm --module node16",
"build-all": "pnpm build"
},
Expand Down
1 change: 0 additions & 1 deletion pkg/shared/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from '@slangroom/shared/gen-types';
export * from '@slangroom/shared/jsonable';
export * from '@slangroom/shared/tokens';
export * from '@slangroom/shared/zenroom';
Loading