简体   繁体   English

Angular 通用构建 baseHref 更改中断应用程序中的路由 angular

[英]Angular universal build baseHref change breaks angular routing in app

I have an angular application set up to build prior to deployment to AWS lambda. The serverless.yml file uses the stage: production entry, prefixing the deployment with /production .我有一个 angular 应用程序设置为在部署到 AWS lambda 之前构建serverless.yml文件使用stage: production条目,在部署前加上前缀/production When built and deployed this way, the generated styles, polyfills, and main js files return 403 errors.以这种方式构建和部署时,生成的 styles、polyfill 和主要 js 文件返回 403 错误。 If I change the production build baseHref: production/ in angular.json, the files can be found when deployed, but the angular routing breaks due to an unmatching url segment 'production'.如果我在 angular.json 中更改生产构建baseHref: production/ ,则可以在部署时找到这些文件,但 angular 路由由于不匹配的 url 段“生产”而中断。 Adding a production route to the angular routing breaks everything completely.将生产路线添加到 angular 路线会彻底破坏一切。 Is there a way to fix this pathing issue?有没有办法解决这个路径问题?

Try using the deployUrl option in angular.json尝试使用angular.json中的deployUrl选项

deployUrl: '/production/'

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ReferenceError: IDBIndex 未在 angular 通用应用程序中定义 - ReferenceError: IDBIndex is not defined in angular universal app Google Cloud App Engine 中的 Angular 7 路由不起作用 - Angular 7 Routing in Google Cloud App Engine not working Angular Universal 13 和 Angularfire 7 -> Google App Engine 部署错误 - Angular Universal 13 and Angularfire 7 -> Google App Engine deployment error 通过运行“npm run build:ssr”构建 Angular 通用项目后,dist/browser 中缺少 index.html - Missing index.html in dist/browser after building Angular universal projects by running "npm run build:ssr" Google Cloud Run with Angular 通用监听端口错误 - Google Cloud Run with Angular Universal listening port error Angular 通用快递服务器显示 function url 而不是条目 url - Angular universal express server shows function url instead of entry url Angular 通用显示注释而不是动态组件数据 - Angular Universal displays comments instead of dynamic component data 我的 Angular web 应用程序按预期通过按钮进行路由,但是当我在 url 中键入页面路径时,路由不起作用。 托管于 firebase - My Angular web app is routing through buttons as expected, but when I type the page path in the url, routing doesn't work. While hosted on firebase 在 Azure blob 存储上托管时如何使 Angular 路由工作 - How to get Angular routing working when hosting on Azure blob storage 将 angular 构建部署到 S3 存储桶 - Deploying angular build to S3 bucket
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM