-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[RFC] Fix for absolute paths #290
[RFC] Fix for absolute paths #290
Conversation
Add new improvements
Add all new commits
Tested on Windows 10. Still seeing the same error message with these changes. |
Ow it fixed it on os x, i'll look into a better fix on windows in a bit |
@brandon93s just loaded it up on Windows 10 and this seems resolved, could u elaborate what u exactly tried? |
index.html: <!DOCTYPE html>
<html>
<body>
<h1>Index</h1>
<a href="/other.html">Other</h1>
</body>
</html> other.html <!DOCTYPE html>
<html>
<body>
<h1>Other</h1>
</body>
</html> command: parcel .\index.html Same error if I move |
@brandon93s i can't seem to get an issue with that exact setup i however use |
User error. Checked out the branch again... working... |
src/Asset.js
Outdated
@@ -65,6 +65,10 @@ class Asset { | |||
return url; | |||
} | |||
|
|||
if (url.indexOf('/') === 0) { | |||
url = path.join(this.options.rootDir, url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will work for files that are in the direct project being bundled, but what about absolute paths inside packages in node_modules
? Seems like those should probably be relative to that package, not the whole project maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ow didn't know that happened i'll try find a better way than
…el into feature/absolute-paths
I improved this PR to support both ~ and / as well as proper detection for unix like absolute paths, added some tests and also support nested node_modules, this now supports any use case i can think of |
This is really important! |
What’s the status of this PR? |
@davidnagli waiting on approval of the community than some finishing up and improving based on new additions to the codebase and than it should be ready to go |
Fixes absolute paths in html and other assets closes #86
Removes the need for other project relative solutions closes #336 closes #466