Skip to content

Commit

Permalink
Remove ncc (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
prettymuchbryce authored Sep 12, 2020
1 parent 2335cf6 commit f8bcc28
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 21 deletions.
8 changes: 1 addition & 7 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"@types/markdown-table": "^2.0.0",
"@typescript-eslint/eslint-plugin": "^3.9.0",
"@typescript-eslint/parser": "^3.9.1",
"@vercel/ncc": "^0.23.0",
"eslint": "^7.7.0",
"eslint-config-airbnb-typescript": "^9.0.0",
"eslint-plugin-import": "^2.22.0",
Expand Down
14 changes: 2 additions & 12 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
#!/bin/bash
rm -rf ./build
rm -rf ./build-tmp
tsc --project tsconfig-build.json
ncc build ./build-tmp/index.js -o ./build/cjs
cat ./build-tmp/index.d.ts >> ./build-tmp/codes.d.ts
# Because we are concatting .d.ts files, we need to remove all imports of codes.ts from index.ts
sed -i.old '/^import/d' ./build-tmp/codes.d.ts
# as well as exports that already exist within codes.ts
sed -i.old '/^export { StatusCodes, ReasonPhrases, }/d;' ./build-tmp/codes.d.ts
mv ./build-tmp/codes.d.ts ./build/cjs/index.d.ts
rm -rf ./build-tmp
tsc --project tsconfig-build.json
mv ./build-tmp ./build/es/
tsc --project tsconfig-cjs.json
tsc --project tsconfig-es.json
2 changes: 2 additions & 0 deletions tsconfig-build.json → tsconfig-cjs.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
"outDir": "./build/cjs/",
"resolveJsonModule": false
},
"extends": "./tsconfig.json"
Expand Down
7 changes: 7 additions & 0 deletions tsconfig-es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"resolveJsonModule": false,
"outDir": "./build/es/"
},
"extends": "./tsconfig.json"
}
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"declaration": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"outDir": "./build-tmp/",
"resolveJsonModule": true,
"moduleResolution": "node"
},
Expand Down

0 comments on commit f8bcc28

Please sign in to comment.