Repository navigation
scripts path in index.html does not follow deployUrl defined in .angular-cli.json in 1.4.0 #7628
Description
Activity
Same issue here.
Versions:
@angular/cli: 1.4.0 node: 6.11.2 os: win32 x64 @angular/animations: 4.3.6 @angular/common: 4.3.6 @angular/compiler: 4.3.6 @angular/core: 4.3.5 @angular/forms: 4.3.6 @angular/http: 4.3.6 @angular/platform-browser: 4.3.6 @angular/platform-browser-dynamic: 4.3.6 @angular/router: 4.3.6 @angular/cli: 1.4.0 @angular/compiler-cli: 4.3.6 @angular/language-service: 4.3.6 @angular/platform-server: 4.3.6 typescript: 2.4.2Repro:
.angular-cli.json:"apps": [ { "root": "src", "outDir": "dist", "assets": [ "assets", "favicon.ico" ], "index": "index.html", "main": "main.ts", "polyfills": "polyfills.ts", "test": "test.ts", "tsconfig": "tsconfig.app.json", "testTsconfig": "tsconfig.spec.json", "prefix": "app", "styles": [ "assets/styles/jquery.bxslider.css", "assets/styles/main.scss" ], "scripts": [ "assets/scripts_include/jquery-1.11.3.min.js", "assets/scripts_include/jquery-ui.min.js", "assets/scripts_include/jquery.ui.touch-punch.min.js", "assets/scripts_include/jquery.bxslider.min.js" ], "environmentSource": "environments/environment.ts", "environments": { "dev": "environments/environment.ts", "prod": "environments/environment.prod.ts", "qa": "environments/environment.qa.ts", "uat": "environments/environment.uat.ts" } } ]Running
ng build --dev --environment=dev --deploy-url=/dist/ -smresults in index.html with botched scripts file reference:<script type="text/javascript" src="/dist/inline.bundle.js"></script> <script type="text/javascript" src="/dist/polyfills.bundle.js"></script> <script type="text/javascript" src="scripts.bundle.js"></script> <script type="text/javascript" src="/dist/styles.bundle.js"></script> <script type="text/javascript" src="/dist/vendor.bundle.js"></script> <script type="text/javascript" src="/dist/main.bundle.js"></script>Workaround for now is to fix the path manually, but it is a small issue during development.
Additional info:
I haven't had a chance to investigate properly, but I'm somewhat sure the issue was introduced within e8f27f0 , see the new logic for globalScriptsByEntry reduce in packages/@angular/cli/models/webpack-configs/common.ts and the new logic in packages/@angular/cli/plugins/insert-concat-assets-webpack-plugin.tssame here. How soon do they normally fix these sort of bugs? This was an untimely release for us.
We should fix this one ASAP. I'm investigating and will try to do an emergency release today.
- added 2 commits that reference this issue
on Sep 8, 2017 - added 2 commits that reference this issue
on Sep 8, 2017 This has been released in 1.4.1. Try it out and if there's a problem, open another issue please.
@hansl updated to 1.4.1
but my problem still looks like this wrong path- added a commit that references this issue
on Apr 23, 2018 angular-automatic-lock-bot commented
on Sep 8, 2019 More actionsThis issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
- locked and limited conversation to collaborators
on Sep 8, 2019 - added a commit that references this issue
on May 29, 2026

Bug Report or Feature Request (mark with an
x)Versions.
@angular/cli: 1.4.0
node: 8.0.0
os: darwin x64
@angular/animations: 4.3.6
@angular/common: 4.3.6
@angular/compiler: 4.3.6
@angular/core: 4.3.6
@angular/forms: 4.3.6
@angular/http: 4.3.6
@angular/platform-browser: 4.3.6
@angular/platform-browser-dynamic: 4.3.6
@angular/router: 4.3.6
@angular/cli: 1.3.2
@angular/compiler-cli: 4.3.6
@angular/language-service: 4.3.6
Repro steps.
.angular-cli.json: (Note the
deployUrl)After I run
ng build --prod, theindex.htmlintarget/my-app:Note the scripts path is not under
my-app, but the the scripts file is undermy-appdirectory. As a result, scripts cannot be fount in browser.1.3.2 does not have this problem.
Thanks!