We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Workers can import JSON like this:
import Something from './file.json'
But you can't do that anywhere else.
This works in Chrome and node, etc:
import Something from './file.json' with {type: "json"}
But does not work in workers, you get:
It would be nice to have workers support "with type" so it can be used in various places without having to change it specifically for workers.
Spec: https://github.com/tc39/proposal-import-attributes
Supported almost everywhere: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#browser_compatibility
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the solution
Workers can import JSON like this:
But you can't do that anywhere else.
This works in Chrome and node, etc:
But does not work in workers, you get:
It would be nice to have workers support "with type" so it can be used in various places without having to change it specifically for workers.
Spec: https://github.com/tc39/proposal-import-attributes
Supported almost everywhere: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#browser_compatibility
The text was updated successfully, but these errors were encountered: