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

Support native import css/json modules #3580

Open
josecanciani opened this issue Nov 5, 2021 · 2 comments
Open

Support native import css/json modules #3580

josecanciani opened this issue Nov 5, 2021 · 2 comments
Labels

Comments

@josecanciani
Copy link

josecanciani commented Nov 5, 2021

import sheet from './myModule.css' assert { 'type': 'css' };
import sheet from './config.json' assert { 'type': 'json' };

these are valid imports in Chromium/Chrome. It would be nice if we could support, right now the "assert" keyword is an unknown one.

Here's a dynamic import example:

const sheet = (await import('./myModule.css', { assert: { type: 'css' } })).default;

More info: https://v8.dev/features/import-assertions

Thanks!

@Abrifq
Copy link

Abrifq commented Nov 6, 2021

Also adding this:
It's in stage 3.

https://tc39.es/proposal-import-assertions/

@jugglinmike
Copy link
Member

Sounds good to me. (As per JSHint's policy on new language features, this became in-scope when the proposal entered "stage 3" of TC39's process, so we're actually lagging behind on this one.)

As always, I'll be happy to help anyone interested in contributing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants