mirror of
https://github.com/swc-project/swc.git
synced 2024-11-24 02:06:08 +03:00
feat(es/config): Accept jsc.experimental.keepImportAssertions
(#7995)
**Related issue:** - Closes #7923.
This commit is contained in:
parent
3eb23eba7b
commit
4d777ee270
@ -1497,7 +1497,7 @@ pub struct JscExperimental {
|
||||
#[serde(default)]
|
||||
pub plugins: Option<Vec<PluginConfig>>,
|
||||
/// If true, keeps import assertions in the output.
|
||||
#[serde(default)]
|
||||
#[serde(default, alias = "keepImportAssertions")]
|
||||
pub keep_import_attributes: BoolConfig<false>,
|
||||
|
||||
#[serde(default)]
|
||||
|
17
crates/swc/tests/fixture/issues-7xxx/7908/input/3/.swcrc
Normal file
17
crates/swc/tests/fixture/issues-7xxx/7908/input/3/.swcrc
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/swcrc",
|
||||
"jsc": {
|
||||
"parser": {
|
||||
"syntax": "typescript"
|
||||
},
|
||||
"target": "es2022",
|
||||
"experimental": {
|
||||
"keepImportAssertions": true,
|
||||
"emitAssertForImportAttributes": true
|
||||
}
|
||||
},
|
||||
"module": {
|
||||
"type": "es6"
|
||||
},
|
||||
"isModule": true
|
||||
}
|
3
crates/swc/tests/fixture/issues-7xxx/7908/input/3/1.js
Normal file
3
crates/swc/tests/fixture/issues-7xxx/7908/input/3/1.js
Normal file
@ -0,0 +1,3 @@
|
||||
import packageJSON from "./package.json" assert { type: "json" };
|
||||
|
||||
console.log(packageJSON)
|
4
crates/swc/tests/fixture/issues-7xxx/7908/output/3/1.js
Normal file
4
crates/swc/tests/fixture/issues-7xxx/7908/output/3/1.js
Normal file
@ -0,0 +1,4 @@
|
||||
import packageJSON from "./package.json" assert {
|
||||
type: "json"
|
||||
};
|
||||
console.log(packageJSON);
|
Loading…
Reference in New Issue
Block a user