Skip to content
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

Add publicUrl option to config #464

Closed
1 task done
Xiphe opened this issue Feb 1, 2018 · 3 comments
Closed
1 task done

Add publicUrl option to config #464

Xiphe opened this issue Feb 1, 2018 · 3 comments
Assignees
Labels
Awaiting Reply This PR or Issue needs a reply from the original reporter.

Comments

@Xiphe
Copy link
Contributor

Xiphe commented Feb 1, 2018

Stencil version:

@stencil/core@future

I'm submitting a:

  • feature request

Current behavior:

the loader script does figure out the correct relative path which all lazy loaded files should use

Which is nice for most use cases and allows the config to not care about urls.
Drawback of this approach:

  • does not support async scripts
  • does not support moving the loader script relative to the lazy loaded files which might be useful for
    • inlining the loader
    • serving loader from different url (for CDN/caching reasons)

Expected behavior:

I would love to be able to provide a publicUrl via the config from which all lazy loaded files are loaded

Steps to reproduce:

  • build a stencil app
  • move the loader to another place
  • update index.html to still load the loader
  • see failing requests in network

Related code:

src/client/loader.ts#L28-L34

Other information:

ref #307

If this sounds feasible to you, I'd love to work on a PR.

This is a sub-issue of #523

@jgw96
Copy link
Contributor

jgw96 commented Feb 5, 2018

Hey! We have a publicPath config https://stenciljs.com/docs/config that changes the path where the loader file looks for your components. Is that what you are looking for in this case?

@jgw96 jgw96 added the Awaiting Reply This PR or Issue needs a reply from the original reporter. label Feb 5, 2018
@Xiphe
Copy link
Contributor Author

Xiphe commented Feb 6, 2018

As @adamdbradley mentioned in his comment on #307: "the publicPath which is hardcoded into the loader script is just a fallback"

So this config is not used - thats why I opened this issue.

@adamdbradley adamdbradley added this to the 0.5.0 milestone Feb 6, 2018
@adamdbradley adamdbradley self-assigned this Feb 8, 2018
@Xiphe Xiphe mentioned this issue Feb 11, 2018
1 task
@adamdbradley
Copy link
Contributor

Should be fixed in the next release, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Reply This PR or Issue needs a reply from the original reporter.
Projects
None yet
Development

No branches or pull requests

3 participants