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

Import assertions are lost #331

Open
JohnCampionJr opened this issue Oct 30, 2023 · 1 comment
Open

Import assertions are lost #331

JohnCampionJr opened this issue Oct 30, 2023 · 1 comment

Comments

@JohnCampionJr
Copy link

JohnCampionJr commented Oct 30, 2023

Environment

Node 18

Reproduction

Put a JSON import with an assertion to a TS file and run unbuild

Describe the bug

import pkg from 'npm-package/package.json' assert { type: "json" }

loses the assert and becomes

import pkg from 'npm-package/package.json'

Additional context

Note that package.json is actually exported by the package I'm using. It works fine otherwise.

ESBuild leaves it alone as expected in ESM formats.

Logs

No response

@JohnCampionJr
Copy link
Author

This is a low priority and can be closed if you don't want to fix; I found an alternate way to accomplish what I was looking to do :)

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

No branches or pull requests

1 participant