相关疑难解决方法(0)

Angular 2 CLI - 部署

我使用Angular 2 CLI构建了一个Angular 2应用程序.我的问题是,现在我想将应用程序部署到本地服务器,作为其他人可以查看的临时环境.

大多数使用Angular 2 CLI的教程都显示了一个dist文件夹,该文件夹似乎是在使用CLI首次创建项目时生成的.我只能dist使用生成文件夹ng build.我假设Angular 2 CLI更改了最初dist文件夹是初始文件夹结构的一部分,但现在它只在使用时生成ng build

作为测试,我将生成的dist文件夹复制到wwwWAMP服务器的文件夹[ http:// localhost:8080/Project/dist /]以尝试运行应用程序...浏览器控制台显示:

Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:8080/inline.js
Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:8080/bundle.js
Run Code Online (Sandbox Code Playgroud)

它在本地服务器的根目录中查找所有资产,而不是将根目录设置为dist文件夹中index.html的位置.所有的图像和图标都有同样的问题......我想我没有为相对路径配置一些东西......我该怎么办?

deployment angular-cli angular

3
推荐指数
1
解决办法
2458
查看次数

标签 统计

angular ×1

angular-cli ×1

deployment ×1