Neccesity of the .js versions in a newly created project

nativescriptcore

#1

I’ve just started developing in NativeScript, and I noticed that each component had a .js and .ts version of each component. Since I’m more used to working in TypeScript than JavaScript, I’d like to delete the .js files. Would getting rid of the .js files affect the functionality of the app at all?


#2

The .ts files are transpiled into the .js files. The .js files are what’s actually interpreted on the platform (same as anywhere else you’ve used typescript before).

What you can do is hide the .js files from your code editor or IDE. If you’re working in VS Code, this is done by adding the following entry to your settings:


  "files.exclude": {
    "**/*.js": { "when": "$(basename).ts" },
  },

This will prevent the JS files from showing up in your editor’s file browser.