ember-cli / ember-cli

The Ember.js command line utility.

Home Page:https://cli.emberjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fingerprint.prepend not working for the chunk js files

mariusleu opened this issue · comments

Not sure if this is a bug or an expected behaviour, but after using the {fingerprint: {prepend: "https://somecdn.com/"}}, the index.html file contains these lines:

<script src="https://somecdn.com/assets/vendor-85a5ac97a22aad697a7779b2e3e085ed.js"></script>
<script src="/assets/chunk.143.92a6504cf798a9982264.js" integrity="sha256-kEZ4hZpZInBA0SB9gA9o7qT/cLqkSLw13+KuCvLsMQ4= sha512-r9sfVrvVr48lYtdw5e5gtAy5Jq4DyGv5IM5UvKm8v60whUtdyLbEe6roJMB/8Od96McIIuEzvptHaTWUFpLXgA==" ></script>
<script src="https://somecdn.com/assets/ember-test-app-7fdfd3b8f349eb36e9895996c4f1163e.js"></script>

Why doesn't the chunk.{...}.js file get the prepend url? Any way to get that added to those files as well ? (except for doing some custom scripting)

Thank you!


ember-cli: 5.3.0
node: 18.16.0

Hello! Sorry you've run in to a bit of a snag.

You'll have to configure the prefix for the chunks via publicAssetURL, described here: https://github.com/embroider-build/ember-auto-import#customizing-build-behavior

Hi @NullVoxPopuli
Thank you for the hint, I confirm it works by setting both settings like this:

{
      autoImport: {
        publicAssetURL: 'https://mycdn.net/assets',
      },
      fingerprint: {
        prepend: 'https://mycdn.net/'
      }
}

Excellent!