build fails with 0.18.5 (worked in 0.17.4)
@guybedford is already working on this.
Since May 21, 2019.
- Dominant language
- JavaScript
- Stars
- 9.8k
- Forks
- 326
- PR merge metrics
- No merged PRs in 30d
Description
First, a related question that could help me: Where is the documentation for ncc?
The readme file leaves many open question (at least for me as a beginner). And due to this lack of documentation I don't even know how ncc is supposed to work or which questions to ask. So I'm afraid, I must explain the whole use-case.
The build on our CI server was still okay with version 0.17.4 - but now fails with 0.18.5.
To me it seems, that ncc is now somehow finding our top-level tsconfig.json file and it tries to build the whole source code - which will not work, because we have a mono-repo and thus have many different tsconfig.json files.
This is how our code is organized:
tsconfig.json- top level ts configangular.json- .. other files
appsdirclienttsconfig.app.jsontsconfig.jsontsconfig.spec.json
servertsconfig.json
- ...
libsdirshared- ...
node_modulesdirdistdirappsservermain.js- created by the prod buildtsconfig-json- created by our ci-script for ncc - content from your readme file
The ci script will first do a regular ng build of the server app which creates dist/apps/server/main.js. Then the ci script will cd to apps/server/ and execute ncc build main.js --minify --out ncc to build ncc/index.js.
It seems that the newer ncc version will traverse the folder tree up, find the top-level tsconfig.json file and then tries to compile all source code: e.g. in apps/client/... - which will fail, because the top-level tsconfig.json file is not suitable for that source code.
As a workaround I tried to delete the top-level tsconfig.json file - then the build works.
Questions:
- Why would ncc even try to start the typescript compiler? it already gets the
main.jsfile? - Why would it use the top-level
tsconfig.json, when there is atsconfig.jsonfile in the current directory? - Can I somehow configure which
tsconfig.jsonfile it should use?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.