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

webpack 5 with shared angular project ignoring tsconfig.tns.json

Open bufke opened this issue 3 years ago • 1 comments

Environment

✔ Getting NativeScript components versions information... ✔ Component nativescript has 8.0.1 version and is up to date. ✔ Component @nativescript/core has 8.0.3 version and is up to date. ✖ Component @nativescript/ios is not installed. ✔ Component @nativescript/android has 8.0.0 version and is up to date.

See https://gitlab.com/burke-software/simple-fan-control/-/tree/ns8-broken as an example for producing

Describe the bug

I maintain two open source Angular + Nativescript projects with the previously recommended way (schematics) to share code. I can't run either one in NativeScript 8 with webpack 5. I suspect at least one problem is that the tsconfig.tns.json file is no longer used.

  • Seeing other issues, it appears there is little support for shared code this way. Is there any official answer if NS 8 explicitly breaks it or is it still possible to get working?
  • It looks like the reading of tsconfig.tns.json is set in the older webpack format. Is there a way to use this file with webpack 5?

I suspect the tsconfig file because I can clearly see that my files, skip lib, exclude lines are being ignored. Merging this into my tsconfig.json file instead at least gets me different errors (and breaks the web version).

To Reproduce

Clone the simple-fan-control branch and run ns run android

Expected behavior

Project should run

Sample project

  • Simple Fan Control https://gitlab.com/burke-software/simple-fan-control/-/tree/ns8-broken
  • Passit https://gitlab.com/passit/passit-frontend (run ns migrate first)

Additional context

Seeing other comments, I realize this method of code sharing is not favored. Personally, I would love if the NS team could post some clarification. IMO explicitly ending support would be preferable to it just kind of not working well. Is anyone here running webpack 5 with this method of code sharing successfully? Thank you!

bufke avatar May 02 '21 14:05 bufke

I'd also like to have a working example of code sharing between an Angular web app and Nativescript with the newest webpack. Or was it a design decision to remove such a thing?

Eradev avatar Jul 30 '21 03:07 Eradev