nativescript-dev-webpack icon indicating copy to clipboard operation
nativescript-dev-webpack copied to clipboard

Executing the update script `update-ns-webpack` breaks the AoT compilation in code-sharing projects

Open sis0k0 opened this issue 6 years ago • 0 comments

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.

sis0k0 avatar Jul 11 '19 20:07 sis0k0