I have been developing an angular2 app with the lite server. Now I would like to deploy this app on a tomcat server to connect with a java backend. I have been using angular cli. I have used the command 'ng build -prod' to generate the dist folder. According to the udemy tutorial on angular2, the contents of this folder are all that is required to deploy an angular2 project. I place the contents of this folder in the WebContent folder of the java project, and click the green button in the eclipse IDE to start serving the files. In other projects I can successfully deploy html and javscript files in this way. But for this angular2 project "Loading..." appears and the app never starts. The console shows these errors.
GET http://localhost:8080/vendor/es6-shim/es6-shim.js [HTTP/1.1 404 Not Found 3ms] GET http://localhost:8080/vendor/reflect-metadata/Reflect.js [HTTP/1.1 404 Not Found 4ms] GET http://localhost:8080/vendor/systemjs/dist/system.src.js [HTTP/1.1 404 Not Found 4ms] GET http://localhost:8080/vendor/zone.js/dist/zone.js [HTTP/1.1 404 Not Found 4ms] GET http://localhost:8080/vendor/reflect-metadata/Reflect.js [HTTP/1.1 404 Not Found 1ms] GET http://localhost:8080/vendor/systemjs/dist/system.src.js [HTTP/1.1 404 Not Found 2ms] GET http://localhost:8080/vendor/zone.js/dist/zone.js [HTTP/1.1 404 Not Found 2ms] ReferenceError: System is not defined
These errors seem wierd to me because I see the files exactly in these locations.
When I run ng serve in the angular2 cli project folder, the app runs fine.
How can I deploy the dist folder in a tomcat server without running the light server, or is the light server maybe required to run at the same time? What is the best way to do this?