Run Angular2 as static app in browser without a server

后端 未结 6 1834
日久生厌
日久生厌 2020-12-13 02:06

As I understand the Angular2 concept - it is transpiling TypeScript files to .js files. In principle, it should be possible to compile, package, and then run that Angular2 a

6条回答
  •  粉色の甜心
    2020-12-13 02:46

    How to serve an Angular 2 dist folder index.html to serve an Angular 2 dist folder index.html

    If it's not obvious to everyone, and it wasn't to me. If you want to run the dist folder locally after building it and fixing it base ref, use something like http-server and point it to the dist folder, not any particular file. From the cmd window in your project folder

    c:\user\myProject> http-server ./dist

    as explained in the link

提交回复
热议问题