rspack icon indicating copy to clipboard operation
rspack copied to clipboard

support import attributes

Open ahabhgk opened this issue 2 years ago • 3 comments

https://github.com/tc39/proposal-import-attributes

  • webpack-tests/cases/json/import-assertions-type-json

ahabhgk avatar Oct 18 '23 10:10 ahabhgk

This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

stale[bot] avatar Dec 17 '23 10:12 stale[bot]

@ahabhgk what's the current status of this issue?

I tried the following code in Rspack and it works:

import test from "./foo.json" with { type: "json" };

console.log(test);

chenjiahan avatar Apr 23 '24 05:04 chenjiahan

I think it was transformed by SWC, if I add the swc.jsc.experimental.keepImportAttributes: true option, I will get the parsing error:

image

chenjiahan avatar Apr 23 '24 05:04 chenjiahan

This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

stale[bot] avatar Jun 22 '24 06:06 stale[bot]

close since this seems solved

hardfist avatar Aug 13 '24 03:08 hardfist