This repository was archived by the owner on Aug 7, 2021. It is now read-only.
This repository was archived by the owner on Aug 7, 2021. It is now read-only.
Executing the update script update-ns-webpack
breaks the AoT compilation in code-sharing projects #980
Open
Description
Describe the bug
The newly generated code-sharing applications come with a custom tsconfig.tns.json
configuration file. Executing the update script from nativescript-dev-webpack
(npx update-ns-webpack --configs
) overrides the existing tsconfig.tns.json
file with the default configuration file - https://github.com/NativeScript/nativescript-dev-webpack/blob/master/templates/tsconfig.tns.json.
However, the AoT compilation in the code-sharing project doesn't work with the default tsconfig
file.
To Reproduce
npm i -g @angular/cli @nativescript/schematics@next
ng new --collection=@nativescript/schematics my-shared-project --shared
cd my-shared-project
npx update-ns-webpack --configs
tns build --bundle --env.aot
Expected behavior
Executing the update script for the webpack plugin shouldn't break the code-sharing project.
Suggested solutions
- Don't update the
tsconfig.tns.json
file at all. - In the update script, read the
tsconfig.tns.json
file and omit its update if its content matches exactly the content of a code-sharing config file. - Detect that the project is a code-sharing one and then - skip the update of the
tsconfig.tns.json
file. - Please comment with any suggestions you might have.