diff --git a/crates/oxc_codegen/tests/integration/snapshots/minify.snap b/crates/oxc_codegen/tests/integration/snapshots/minify.snap index ff677eb432568..81ec0162866dc 100644 --- a/crates/oxc_codegen/tests/integration/snapshots/minify.snap +++ b/crates/oxc_codegen/tests/integration/snapshots/minify.snap @@ -232,3 +232,19 @@ class C { } ---------- class C{static static;static bar(){}} +########## 43 +type T = typeof import('react'); +---------- +type T=typeof import("react"); +########## 44 +type U = typeof import("vue"); +---------- +type U=typeof import("vue"); +########## 45 +type V = typeof import('some-module').SomeType; +---------- +type V=typeof import("some-module").SomeType; +########## 46 +type W = typeof import('pkg').default; +---------- +type W=typeof import("pkg").default; diff --git a/crates/oxc_codegen/tests/integration/snapshots/ts.snap b/crates/oxc_codegen/tests/integration/snapshots/ts.snap index 74fc3a5e6f3de..a24b6ac57e0fd 100644 --- a/crates/oxc_codegen/tests/integration/snapshots/ts.snap +++ b/crates/oxc_codegen/tests/integration/snapshots/ts.snap @@ -349,3 +349,23 @@ class C { static static; static bar() {} } + +########## 43 +type T = typeof import('react'); +---------- +type T = typeof import('react'); + +########## 44 +type U = typeof import("vue"); +---------- +type U = typeof import('vue'); + +########## 45 +type V = typeof import('some-module').SomeType; +---------- +type V = typeof import('some-module').SomeType; + +########## 46 +type W = typeof import('pkg').default; +---------- +type W = typeof import('pkg').default; diff --git a/crates/oxc_codegen/tests/integration/ts.rs b/crates/oxc_codegen/tests/integration/ts.rs index 5da77b640b18b..ff8ca70f3a0c6 100644 --- a/crates/oxc_codegen/tests/integration/ts.rs +++ b/crates/oxc_codegen/tests/integration/ts.rs @@ -133,6 +133,11 @@ export import b = require("b"); static bar() {} }", + // TSImportType - ensure backticks are not used in minify mode + "type T = typeof import('react');", + "type U = typeof import(\"vue\");", + "type V = typeof import('some-module').SomeType;", + "type W = typeof import('pkg').default;", ]; snapshot("ts", &cases);