-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Draft: Deep import HTML and non-ESM files with exports and ?url
query
#7097
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('foo') |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<div>foo</div> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,15 @@ <h2>Deep import with exports field</h2> | |
<h2>Deep import with query with exports field</h2> | ||
<p class="exports-deep-query">fail</p> | ||
|
||
<h2>Deep import SVG file with query with exports field</h2> | ||
<p class="exports-deep-svg-query">fail</p> | ||
|
||
<h2>Deep import HTML file with query with exports field</h2> | ||
<p class="exports-deep-html-query">fail</p> | ||
|
||
<h2>Deep import non-ESM file with query with exports field</h2> | ||
<p class="exports-deep-non-esm-query">fail</p> | ||
|
||
<h2>Deep import with exports field + exposed directory</h2> | ||
<p class="exports-deep-exposed-dir">fail</p> | ||
|
||
|
@@ -107,6 +116,18 @@ <h2>resolve package that contains # in path</h2> | |
import deepPath from 'resolve-exports-path/deep.json?url' | ||
text('.exports-deep-query', deepPath) | ||
|
||
// deep import SVG w/ exports w/ query | ||
import deepSvgPath from 'resolve-exports-path/deep.svg?url' | ||
text('.exports-deep-svg-query', deepSvgPath) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one works 👍 So we can rule out the problem of it only working with |
||
|
||
// deep import HTML w/ exports w/ query | ||
import deepHtmlPath from 'resolve-exports-path/deep.html?url' | ||
text('.exports-deep-html-query', deepHtmlPath) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without any But when
|
||
|
||
// deep import non-ESM w/ exports w/ query | ||
import deepNonEsmPath from 'resolve-exports-path/deep-non-esm.js?url' | ||
text('.exports-deep-non-esm-query', deepNonEsmPath) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without any But when
|
||
|
||
// deep import w/ exposed dir | ||
import { msg as exposedDirMsg } from 'resolve-exports-path/dir/dir' | ||
text('.exports-deep-exposed-dir', exposedDirMsg) | ||
|
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.
cc @sapphi-red since you recently fixed up a super similar and relevant case in #7073, I was curious if you had any insights or hunches about what is additionally going wrong.
(the testing and comments here are done on the latest
main
with your fix)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.
Sorry I noticed that my fiix was broken.
I have made a PR which fixes (#7098).
This would work with
.html
and others.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.
@sapphi-red Thanks for taking a look and proposing a change already!