-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[QUESTION] main.tns.ts is missing from the TypeScript compilation Nativescript / Angular + Nativescript/webpack Shared project. #9519
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
Comments
Here is my TsConfig.tns.json file: |
interesting to note it does show me that it's using... |
Seems this was unanswered here: NativeScript/nativescript-dev-webpack#1154 @bufke do you have any insight? |
You would be better served by someone on the NativeScript team. However, to my best understanding, you will never succeed in trying to use a NS shared project using the .tns. method. The previously shared approach was done by the telerek team and the current maintainers do not agree with it nor have time to support it. I can understand the position the current maintainers are in is tough and find no blame on them. The current recommended approach is to rewrite your app using something like NX. I started doing this for a smaller app I have and found it to really be on the level of rewrite. For me, it resulted in about 50% more lines of code. My app and web code are really intended to have feature parity, making the .tns.* method highly effective for me. If your web/app code are not tightly coupled, then it may not be such a big deal for you. NX makes it easy to share packages between projects but it does not work well if you only want to replace html with nativescript templates. You may want to consider other options like Flutter which make it much easier to reuse app/web presentation code. |
@bufke I figured they put the tsconfig plugin inside @nativescript/webpack to showcase how you can dynamically use a different tsconfig file. However, show cases tsConfigPath that we need to be able to edit. Literally adding the lines from nativescript-dev-webpack (4 or before) checking if a path resolves to tsconfig.tns.json Could we edit our webpack.config file to
and pass in the tns config file? |
Show cases they hardcode tsconfig.app.json :( |
Okay, even when I edit that.... to tns.json I run into polyfills.ts vs polyfills.tns.ts. Lower down that file, I can edit polyfills to tns as well - but still have tons of build issues |
Closed based off the response from core team:NativeScript/angular#28 |
How do we move forward with a tsconfig.app.json file for web (angular.json) and a tsconfig.tns.json file for Nativescript?
in a @nativescript/schematics project we had a tsconfig.json and a tsconfig.tns.json file. Inside the webpack.config.js file we had several lines where they mapped the tsconfig file based on the one in the angular.json file to the tns.json file to the env.json file and it would use the most detailed one by default.
in Nativescript/Webpack 5 beta we can see it points us to use TsconfigPathsPlugin
So I still have the tsconfig json file for angular web. This includes main.ts, polyfills.ts, etc. However, when I run the app vis ns debug - it uses the tsconfig.json file from angular.json. Okay, so I figured I needed to update the new webpack.config file to tell it what one to use. I see it tells me to add 'TsconfigPathsPlugin' based on the docs. However, I added the code below to my config file and it's still using the other tsConfig.app.js file
The text was updated successfully, but these errors were encountered: