我正在用Angular6+
构建应用程序,现在我运行命令ng build --prod
,它给了我一个dist文件夹.如何在Localhost上判断或提供该文件夹?
我正在用Angular6+
构建应用程序,现在我运行命令ng build --prod
,它给了我一个dist文件夹.如何在Localhost上判断或提供该文件夹?
你可以用http-server个Package.
首先安装软件包globally
npm install http-server -g
然后在项目目录中(终端中)运行
http-server dist/
如果你使用的是Angular 6+或以上(Working with Angular 10),你必须 run
http-server dist/your-project-name
现在您可以访问http://localhost:8080查看您的应用程序