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

Remove ncc #61

Merged
merged 1 commit into from
Sep 12, 2020
Merged
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
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