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

Generating relative paths #135

Closed
thewilkybarkid opened this issue Jan 22, 2021 · 3 comments · Fixed by #136
Closed

Generating relative paths #135

thewilkybarkid opened this issue Jan 22, 2021 · 3 comments · Fixed by #136

Comments

@thewilkybarkid
Copy link

Related to #134, is there a way to generate relative paths rather than root-relative?

I'm achieveing the same in Parcel with --public-url ./, but doesn't seem like --canonical-root can support it?

@papandreou
Copy link
Collaborator

No, that's not supported. We felt that root-relative paths were the safest default, because of things like <base href=...> and font urls in the JavaScript-based preload polyfill. It'd certainly be possible to add a --prefer-relative switch, but it would come at the expense of some extra complexity.

Could you write a few lines about your use case?

@papandreou
Copy link
Collaborator

@thewilkybarkid, turns out it wasn't that much of a complication to implement 😅. Could you see if #136 does what you need?

@thewilkybarkid
Copy link
Author

Could you write a few lines about your use case?

It's only for local development, where it's not necessarily being served from the root (PhpStorm's built-in server doesn't, likewise loading directly from the filesystem). Easy to work around by using serve or similar.

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