Skip to content

publicPath 'auto' doesn't build CDN as expected. #412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nitsujri opened this issue Apr 25, 2025 · 0 comments
Open

publicPath 'auto' doesn't build CDN as expected. #412

nitsujri opened this issue Apr 25, 2025 · 0 comments

Comments

@nitsujri
Copy link

Not sure if I should've opened a new issue or not, and I know this is like 1.5 years ago, but I FINALLY just tried this.

Sadly, I couldn't get it to work.

Specifically: public_path = chunk_file.get("publicPath") ends up looking like "auto023cc06898b0b15eeedc.svg". After playing with it for a while, I realized the webpack-stats.json looks like this:

    "023cc06898b0b15eeedc.svg": {
      "name": "023cc06898b0b15eeedc.svg",
      "path": "...",
      "publicPath": "auto023cc06898b0b15eeedc.svg"
    },
  }
  "chunks": { ... },
  "publicPath": "auto"

So, I believe it is supposed to be:

    public_path = self.get_assets().get("publicPath", None)
    if public_path != "auto":
        return public_path

Above probably isn't great to call get_assets() every file even if it is cached. Probably recommend passing assets into the get_chunk_url

I'm not 100% sure if this is correct though, so welcome to feedback first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant