Title: Scripts.bundle.js deploy-url wrongly prefixed when deviating from standard project structure · Issue #8127 · angular/angular-cli · GitHub
Open Graph Title: Scripts.bundle.js deploy-url wrongly prefixed when deviating from standard project structure · Issue #8127 · angular/angular-cli
X Title: Scripts.bundle.js deploy-url wrongly prefixed when deviating from standard project structure · Issue #8127 · angular/angular-cli
Description: Bug Report or Feature Request (mark with an x) - [X] bug report -> please search issues before submitting - [ ] feature request Versions. @angular/cli: 1.4.3 node: 6.11.3 os: darwin x64 Repro steps. SETUP: $ ng new scripts-test $ npm ins...
Open Graph Description: Bug Report or Feature Request (mark with an x) - [X] bug report -> please search issues before submitting - [ ] feature request Versions. @angular/cli: 1.4.3 node: 6.11.3 os: darwin x64 Repro steps...
X Description: Bug Report or Feature Request (mark with an x) - [X] bug report -> please search issues before submitting - [ ] feature request Versions. @angular/cli: 1.4.3 node: 6.11.3 os: darwin x64 Repro st...
Opengraph URL: https://github.com/angular/angular-cli/issues/8127
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Scripts.bundle.js deploy-url wrongly prefixed when deviating from standard project structure","articleBody":"\u003c!--\r\nIF YOU DON'T FILL OUT THE FOLLOWING INFORMATION YOUR ISSUE MIGHT BE CLOSED WITHOUT INVESTIGATING\r\n-->\r\n### Bug Report or Feature Request (mark with an `x`)\r\n```\r\n- [X] bug report -> please search issues before submitting\r\n- [ ] feature request\r\n```\r\n\r\n### Versions.\r\n\u003c!--\r\nOutput from: `ng --version`.\r\nIf nothing, output from: `node --version` and `npm --version`.\r\n Windows (7/8/10). Linux (incl. distribution). macOS (El Capitan? Sierra?)\r\n-->\r\n@angular/cli: 1.4.3\r\nnode: 6.11.3\r\nos: darwin x64\r\n\r\n### Repro steps.\r\n\u003c!--\r\nSimple steps to reproduce this bug.\r\nPlease include: commands run, packages added, related code changes.\r\nA link to a sample repo would help too.\r\n-->\r\nSETUP:\r\n$ ng new scripts-test\r\n$ npm install --save bootstrap\r\n\r\n--> Move src/main.ts to src/app/main.ts, and update the reference in .angular-cli.json accordingly:\r\nFROM:\r\n\"main\": \"main.ts\",\r\nTO:\r\n\"main\": \"app/main.ts\",\r\n\r\n--> Move src/index.html to src/app/index.html, and update the reference in .angular-cli.json accordingly:\r\nFROM:\r\n\"index\": \"index.html\",\r\nTO:\r\n\"index\": \"app/index.html\",\r\n\r\n--> Update import urls in src/app/main.ts\r\nFROM:\r\nimport { AppModule } from './app/app.module';\r\nimport { environment } from './environments/environment';\r\nTO:\r\nimport { AppModule } from './app.module';\r\nimport { environment } from './../environments/environment';\r\n\r\n--> add to scripts array in .angular-cli.json the line \"../node_modules/bootstrap/dist/js/bootstrap.js\"\r\nFROM:\r\n\"scripts\": [],\r\nTO:\r\n\"scripts\": [\"../node_modules/bootstrap/dist/js/bootstrap.js\"],\r\n\r\n--> Build the project with deploy-url\r\n$ ng build --deploy-url /app\r\n\r\n### Desired functionality.\r\n\u003c!--\r\nWhat would like to see implemented?\r\nWhat is the usecase?\r\n-->\r\nI would like to see some form of consistency within the url building for the bundles. As shown below, every bundles gets prefixed correctly with the deploy-url, except for the scripts bundle.\r\n\r\nResult within index.html:\r\n\u003cscript type=\"text/javascript\" src=\"/app/inline.bundle.js\">\u003c/script>\u003cscript type=\"text/javascript\" src=\"/app/polyfills.bundle.js\">\u003c/script>\r\n**\u003cscript type=\"text/javascript\" src=\"/app/../scripts.bundle.js\">\u003c/script>**\r\n\u003cscript type=\"text/javascript\" src=\"/app/styles.bundle.js\">\u003c/script>\u003cscript type=\"text/javascript\" src=\"/app/vendor.bundle.js\">\u003c/script>\u003cscript type=\"text/javascript\" src=\"/app/main.bundle.js\">\u003c/script>\u003c/body>\r\n\r\n\r\n### Mention any other details that might be useful.\r\n\u003c!-- Please include a link to the repo if this is related to an OSS project. -->\r\nI am using the Angular CLI for a multi-page application (technically hybrid), where I want to encapsulate each separate page in a folder within the /src folder. When I build my application with a specified --deploy-url flag, all urls for the bundles within the index page get built correctly, except for the scripts bundle. This one gets prefixed with \"../\" before being prepended with the deploy-url, rendering the package unreachable when loading the html in a web browser.\r\n","author":{"url":"https://github.com/ArnaudHambenne","@type":"Person","name":"ArnaudHambenne"},"datePublished":"2017-10-20T10:03:42Z","url":"https://github.com/angular/angular-cli/issues/8127"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:843e162f-22fd-59ee-f97a-207c6177ebe9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AFEA:2303A6:1115C30:176715E:6B056462 |
| html-safe-nonce | 0e5f4eb8dcd42c85e780c045dbbcca4cd42b6568aa53d5600f10e9248ff03ce8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkVBOjIzMDNBNjoxMTE1QzMwOjE3NjcxNUU6NkIwNTY0NjIiLCJ2aXNpdG9yX2lkIjoiMzM4NTkyNTgzMDIzNTc0MzMzMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b7256d6aba6215de4386c7631dd237812f5d963583ff3138c6baa4f470c668b8 |
| hovercard-subject-tag | issue:267125762 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/8127/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c28cb38092f1248648fc58efee60b11a17b6dfdca13c1828fce53422e18bc589/angular/angular-cli/issues/8127 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c28cb38092f1248648fc58efee60b11a17b6dfdca13c1828fce53422e18bc589/angular/angular-cli/issues/8127 |
| og:image:alt | Bug Report or Feature Request (mark with an x) - [X] bug report -> please search issues before submitting - [ ] feature request Versions. @angular/cli: 1.4.3 node: 6.11.3 os: darwin x64 Repro steps... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ArnaudHambenne |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1be5cc09efdd4833c24a4ffa71d698e3999fa09071e159fe14c2c08e41c98331 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f6d69234e682c947a48074340e69d45d5901de31 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width