Skip to content

scripts path in index.html does not follow deployUrl defined in .angular-cli.json in 1.4.0 #7628

Closed
@h657070128

Description

@h657070128

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

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)

"apps": [
    {
      "root": "src",
      "outDir": "target/my-app",
      "deployUrl": "my-app",
      "assets": [],
      "index": "index.html",
      "main": "main.ts",
      "polyfills": "polyfills.ts",
      "tsconfig": "tsconfig.app.json",
      "styles": [
        "styles.css"
      ],
      "scripts": [
        "../node_modules/some-libs/file.js",
      ]
    }
  ]

After I run ng build --prod, the index.html in target/my-app:

...
<body>
    <my-app></my-app>
    <script type="text/javascript" src="my-app/inline.6cca322f7e258972d83b.bundle.js"></script>
    <script type="text/javascript" src="my-app/polyfills.1f88e2c5c51b2654c108.bundle.js"></script>
    <script type="text/javascript" src="scripts.4b3dfabee60e0d1b2077.bundle.js"></script>
    <script type="text/javascript" src="my-app/vendor.7e4452b3f0246d32e944.bundle.js"></script>
    <script type="text/javascript" src="my-app/main.4f222f38a3c2a53f4f40.bundle.js"></script>
</body>
...

Note the scripts path is not under my-app, but the the scripts file is under my-app directory. As a result, scripts cannot be fount in browser.

1.3.2 does not have this problem.
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions