Tell me, please, how to run a compiled script without node.js on a web server. Development is carried out locally using the node, but it is not on the server. Is it possible to run the application on the server without installing the node?

UPDATE 06/10/16:

index.html collected as follows: Angular 2 QuickStart

<!-- Polyfill(s) for older browsers --> <script src="node_modules/core-js/client/shim.min.js"></script> <script src="node_modules/zone.js/dist/zone.js"></script> <script src="node_modules/reflect-metadata/Reflect.js"></script> <script src="node_modules/rxjs/bundles/Rx.umd.js"></script> <script src="node_modules/@angular/core/core.umd.js"></script> <script src="node_modules/@angular/common/common.umd.js"></script> <script src="node_modules/@angular/compiler/compiler.umd.js"></script> <script src="node_modules/@angular/platform-browser/platform-browser.umd.js"></script> <script src="node_modules/@angular/platform-browser-dynamic/platform-browser-dynamic.umd.js"></script> <script src="app/app.component.js"></script> <script src="app/app.component.spec.js"></script> <script src="main.js"></script> 

Loading ...

Errors: file: /// G: /test/main.js is not defined

  • And who will execute the application? - Alexey Ten
  • What's the problem? Scripts compiled, must be loaded from the server as normal files. Do you have any backend logic on the node itself? If the node is started only for lite-server, there should be no problems. - Alexandr
  • There is no logic. I just do not quite understand how to connect all this. - Kostiantyn Okhotnyk
  • Suppose I have compiled scripts. Let's say what index.html should look like? - Kostiantyn Okhotnyk
  • one
    Scripts NOT COM PI RU RU U TSYA! ru.wikipedia.org/wiki/… - Riĥard Brugekĥaim

1 answer 1

You just need to put index.html and all dependent scripts in the working directory of the web server in any convenient way (ftp, git, ssh, ..). The web server must be configured to return statics. You need to be attentive with the paths in index.html. Basically, that's all.

  • Ie you just need to connect all the libraries and js that collected node? system.config.js need to connect? - Kostiantyn Okhotnyk
  • Yes, roughly speaking index.html and all that is included in it. I do not know the specifics of your build and do not know about system.config.js, I gave a general answer. If you miss something, it will be visible through 404 errors. Read and correct :). I recommend setting up a web server locally and practice to understand how it works. If there is a guaranteed configured server, train on it. For a web server for an angular application, some specific settings are needed. What files are obtained after assembly? All of them usually publish. - pitersky