0

I am using Angular 2. I am confused with how Angular 2 with typescript works in production environment with Jboss6.

1.After compiling the file in development machine using node, do we need to deploy both .js and .ts to production level?

Tjaart van der Walt
  • 5,149
  • 2
  • 30
  • 50
HAri
  • 57
  • 1
  • 10

3 Answers3

1

Typescript is merely a tool which is a superset of Javascript. After transpiling, your Angular2 code is just plain old Javascript.

You don't need to deploy .ts files on your servers, as no browser will ever understand or parse TypeScript.

If you check your /dist folder that contains your production ready code (if you're using some scaffolding), you'll see that there are only .js files there, in addition to HTML and CSS.

The browser only understands HTML, CSS and Javascript

nikjohn
  • 20,026
  • 14
  • 50
  • 86
1

The browsers only recognize JS files and so when you deploy your app in production should deploy JS files. Typescript is only a superset of Javascript with added features but all Typescript files should be bundled and transpiled.

The main library used for transpiling is Babel for ES6 and the main library for bundling is SystemJS or Webpack.

All is reduced to CSS, JS and HTML files.

Another way, JBoss is a Application Server for Java. For deploy Angular 2 apps you only need a Web Server like Apache, Nginx or Lite-Server.

Deoxyseia
  • 1,359
  • 18
  • 29
  • Can you give some configuration sample in place simple test to read. or i can directly deployed the angular2 code as we in java. – Janny Feb 07 '18 at 22:45
0

You only need to deploy the JS files.

anushr
  • 3,342
  • 3
  • 29
  • 50
Libretto
  • 21
  • 4