将 angular 构建部署到 S3 存储桶
Deploying angular build to S3 bucket
我的问题涉及ng build --prod
之后生成的index.html。这是我在 运行 命令后得到的:
<html lang="en">
<head>
<meta charset="utf-8">
<title>Kudoshealth Dashboard</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="assets/css/all.min.css" rel="stylesheet" type='text/css' />
<link rel="stylesheet" href="styles.f0d4a2f6b4b57a8b1a74.css"></head>
<body>
<app-root></app-root>
<script src="runtime-es2015.5e3efc57355ca9fa37ac.js" type="module"></script><script src=""></script><script src="runtime-es5.5e3efc57355ca9fa37ac.js" nomodule defer></script><script src="polyfills-es5.c9393ad6cf868cd989cc.js" nomodule defer></script><script src="polyfills-es2015.70587aa54d3cd9f0a3b6.js" type="module"></script><script src="scripts.c19d1667b1375f71590b.js" defer></script><script src="main-es2015.654b4a3d66cfb9c8fa63.js" type="module"></script><script src="main-es5.654b4a3d66cfb9c8fa63.js" nomodule defer></script></body>
</html>
这个 angular 项目在本地主机上运行良好,但是一旦将 dist 输出上传到 S3 存储桶,似乎出现了一些问题,例如:
S3 deployed error
我向您保证我使用的登录名是正确的。所有上传的文件也在存储桶中 public。奇怪的错误是dist里面没有8-es2015.8e909eab71372e40cabe.js
文件。如果错误很明显或者我犯了一个菜鸟错误,我真的很抱歉,但我已经被这个错误困住了几天,我们将不胜感激。
我的问题是一个长期存在的问题。通过更改我的 environment.prod.ts 重定向 url 解决了这些问题。它被设置为来自 repo 上旧分支的旧分支,这是多余的。
我的问题涉及ng build --prod
之后生成的index.html。这是我在 运行 命令后得到的:
<html lang="en">
<head>
<meta charset="utf-8">
<title>Kudoshealth Dashboard</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="assets/css/all.min.css" rel="stylesheet" type='text/css' />
<link rel="stylesheet" href="styles.f0d4a2f6b4b57a8b1a74.css"></head>
<body>
<app-root></app-root>
<script src="runtime-es2015.5e3efc57355ca9fa37ac.js" type="module"></script><script src=""></script><script src="runtime-es5.5e3efc57355ca9fa37ac.js" nomodule defer></script><script src="polyfills-es5.c9393ad6cf868cd989cc.js" nomodule defer></script><script src="polyfills-es2015.70587aa54d3cd9f0a3b6.js" type="module"></script><script src="scripts.c19d1667b1375f71590b.js" defer></script><script src="main-es2015.654b4a3d66cfb9c8fa63.js" type="module"></script><script src="main-es5.654b4a3d66cfb9c8fa63.js" nomodule defer></script></body>
</html>
这个 angular 项目在本地主机上运行良好,但是一旦将 dist 输出上传到 S3 存储桶,似乎出现了一些问题,例如:
S3 deployed error
我向您保证我使用的登录名是正确的。所有上传的文件也在存储桶中 public。奇怪的错误是dist里面没有8-es2015.8e909eab71372e40cabe.js
文件。如果错误很明显或者我犯了一个菜鸟错误,我真的很抱歉,但我已经被这个错误困住了几天,我们将不胜感激。
我的问题是一个长期存在的问题。通过更改我的 environment.prod.ts 重定向 url 解决了这些问题。它被设置为来自 repo 上旧分支的旧分支,这是多余的。