Skip to content

Commit 6e471e3

Browse files
committed
Do CommonJS build with custom package.json, tshy inspired
1 parent e02a9bd commit 6e471e3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "type": "commonjs" }

projects/js-packages/number-formatters/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"scripts": {
4343
"build": "pnpm run clean && pnpm run build:esm && pnpm run build:cjs",
4444
"build:esm": "tsc --declarationDir dist/types --outDir dist/mjs",
45-
"build:cjs": "tsc --module CommonJS --moduleResolution node10 --declaration false --outDir dist/cjs",
45+
"build:cjs": "cp package.cjs.json src/package.json && tsc --declaration false --outDir dist/cjs; rm src/package.json",
4646
"clean": "rm -rf dist",
4747
"compile-ts": "tsc --pretty",
4848
"test": "NODE_OPTIONS=--experimental-vm-modules jest",

projects/js-packages/number-formatters/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"compilerOptions": {
44
"typeRoots": [ "./node_modules/@types/", "src/*" ],
55
"target": "ES2024",
6-
"importHelpers": true, // Import helpers from `tslib` instead of inlining them
7-
"customConditions": null // CommonJS build fails when customConditions are defined and this package doesn't need them anyway
6+
"importHelpers": true // Import helpers from `tslib` instead of inlining them
87
},
98
"include": [ "./src/index.ts" ]
109
}

0 commit comments

Comments
 (0)