Skip to content

feat: handle data: imports (non-native only) - #299

Merged
pi0 merged 8 commits into
unjs:mainfrom
bohjak:fix/data-uri-import
Sep 25, 2024
Merged

pi0 merged 8 commits into
unjs:mainfrom
bohjak:fix/data-uri-import

Conversation

@bohjak

@bohjak bohjak commented Sep 21, 2024

Copy link
Copy Markdown
Contributor

Resolves #207

Explicitly check for data: scheme and use native import to handle it.

Comment thread src/require.ts Resolved
@pi0 pi0 changed the title fix: handle data uri with native require feat: handle data: imports Sep 23, 2024
Comment thread src/require.ts Resolved
Comment thread src/require.ts Resolved
Comment thread src/require.ts Resolved
Comment thread test/fixtures/data-uri/index.ts Resolved
@bohjak

bohjak commented Sep 24, 2024

Copy link
Copy Markdown
Contributor Author

@pi0 I've added the data-uri fixture to the ignore lists for the native and bun tests. Breaks native, because it requires ESM. I haven't looked into how exactly bun imports work, but for some reason the require keyword works fine with data URLs, but import doesn't 🤷

@pi0 pi0 changed the title feat: handle data: imports feat: handle data: imports (non-native only) Sep 25, 2024

@pi0 pi0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@pi0
pi0 merged commit 68d5be0 into unjs:main Sep 25, 2024
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

Successfully merging this pull request may close these issues.

data-url modules fail to import

2 participants