diff --git a/internal/bundler_tests/bundler_tsconfig_test.go b/internal/bundler_tests/bundler_tsconfig_test.go index 7f8fe2e11f6..6768c80eec6 100644 --- a/internal/bundler_tests/bundler_tsconfig_test.go +++ b/internal/bundler_tests/bundler_tsconfig_test.go @@ -10,7 +10,7 @@ var tsconfig_suite = suite{ name: "tsconfig", } -func TestTsConfigPaths(t *testing.T) { +func TestTsconfigPaths(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/entry.ts": ` @@ -183,7 +183,7 @@ func TestTsConfigPaths(t *testing.T) { }) } -func TestTsConfigPathsNoBaseURL(t *testing.T) { +func TestTsconfigPathsNoBaseURL(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/entry.ts": ` @@ -323,7 +323,7 @@ func TestTsConfigPathsNoBaseURL(t *testing.T) { }) } -func TestTsConfigBadPathsNoBaseURL(t *testing.T) { +func TestTsconfigBadPathsNoBaseURL(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/entry.ts": ` @@ -381,7 +381,7 @@ Users/user/project/tsconfig.json: WARNING: Non-relative path "http://bad" is not } // https://github.com/evanw/esbuild/issues/913 -func TestTsConfigPathsOverriddenBaseURL(t *testing.T) { +func TestTsconfigPathsOverriddenBaseURL(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/entry.ts": ` @@ -417,7 +417,7 @@ func TestTsConfigPathsOverriddenBaseURL(t *testing.T) { }) } -func TestTsConfigPathsOverriddenBaseURLDifferentDir(t *testing.T) { +func TestTsconfigPathsOverriddenBaseURLDifferentDir(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/entry.ts": ` @@ -453,7 +453,7 @@ func TestTsConfigPathsOverriddenBaseURLDifferentDir(t *testing.T) { }) } -func TestTsConfigPathsMissingBaseURL(t *testing.T) { +func TestTsconfigPathsMissingBaseURL(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/entry.ts": ` @@ -491,7 +491,7 @@ NOTE: You can mark the path "#/test" as external to exclude it from the bundle, }) } -func TestTsConfigPathsTypeOnly(t *testing.T) { +func TestTsconfigPathsTypeOnly(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/entry.ts": ` @@ -529,7 +529,7 @@ func TestTsConfigPathsTypeOnly(t *testing.T) { }) } -func TestTsConfigJSX(t *testing.T) { +func TestTsconfigJSX(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/entry.tsx": ` @@ -552,7 +552,7 @@ func TestTsConfigJSX(t *testing.T) { }) } -func TestTsConfigNestedJSX(t *testing.T) { +func TestTsconfigNestedJSX(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/entry.ts": ` @@ -601,7 +601,7 @@ func TestTsConfigNestedJSX(t *testing.T) { }) } -func TestTsConfigPreserveJSX(t *testing.T) { +func TestTsconfigPreserveJSX(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/entry.tsx": ` @@ -623,7 +623,7 @@ func TestTsConfigPreserveJSX(t *testing.T) { }) } -func TestTsConfigPreserveJSXAutomatic(t *testing.T) { +func TestTsconfigPreserveJSXAutomatic(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/entry.tsx": ` @@ -653,7 +653,7 @@ func TestTsConfigPreserveJSXAutomatic(t *testing.T) { }) } -func TestTsConfigReactJSX(t *testing.T) { +func TestTsconfigReactJSX(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/entry.tsx": ` @@ -681,7 +681,7 @@ func TestTsConfigReactJSX(t *testing.T) { }) } -func TestTsConfigReactJSXDev(t *testing.T) { +func TestTsconfigReactJSXDev(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/entry.tsx": ` @@ -708,7 +708,7 @@ func TestTsConfigReactJSXDev(t *testing.T) { }) } -func TestTsConfigReactJSXWithDevInMainConfig(t *testing.T) { +func TestTsconfigReactJSXWithDevInMainConfig(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/entry.tsx": ` @@ -1501,7 +1501,7 @@ func TestTsconfigIgnoredTargetSilent(t *testing.T) { }) } -func TestTsConfigNoBaseURLExtendsPaths(t *testing.T) { +func TestTsconfigNoBaseURLExtendsPaths(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/entry.ts": ` @@ -1534,7 +1534,7 @@ NOTE: You can mark the path "foo" as external to exclude it from the bundle, whi }) } -func TestTsConfigBaseURLExtendsPaths(t *testing.T) { +func TestTsconfigBaseURLExtendsPaths(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/entry.ts": ` @@ -1566,7 +1566,7 @@ func TestTsConfigBaseURLExtendsPaths(t *testing.T) { }) } -func TestTsConfigPathsExtendsBaseURL(t *testing.T) { +func TestTsconfigPathsExtendsBaseURL(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/entry.ts": ` @@ -1598,7 +1598,7 @@ func TestTsConfigPathsExtendsBaseURL(t *testing.T) { }) } -func TestTsConfigPathsInNodeModulesIssue2386(t *testing.T) { +func TestTsconfigPathsInNodeModulesIssue2386(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/main.js": ` @@ -1645,7 +1645,7 @@ func TestTsConfigPathsInNodeModulesIssue2386(t *testing.T) { }) } -func TestTsConfigWithStatementAlwaysStrictFalse(t *testing.T) { +func TestTsconfigWithStatementAlwaysStrictFalse(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/entry.ts": ` @@ -1666,7 +1666,7 @@ func TestTsConfigWithStatementAlwaysStrictFalse(t *testing.T) { }) } -func TestTsConfigWithStatementAlwaysStrictTrue(t *testing.T) { +func TestTsconfigWithStatementAlwaysStrictTrue(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/entry.ts": ` @@ -1689,7 +1689,7 @@ Users/user/project/tsconfig.json: NOTE: TypeScript's "alwaysStrict" setting was }) } -func TestTsConfigWithStatementStrictFalse(t *testing.T) { +func TestTsconfigWithStatementStrictFalse(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/entry.ts": ` @@ -1710,7 +1710,7 @@ func TestTsConfigWithStatementStrictFalse(t *testing.T) { }) } -func TestTsConfigWithStatementStrictTrue(t *testing.T) { +func TestTsconfigWithStatementStrictTrue(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/entry.ts": ` @@ -1733,7 +1733,7 @@ Users/user/project/tsconfig.json: NOTE: TypeScript's "strict" setting was enable }) } -func TestTsConfigWithStatementStrictFalseAlwaysStrictTrue(t *testing.T) { +func TestTsconfigWithStatementStrictFalseAlwaysStrictTrue(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/entry.ts": ` @@ -1757,7 +1757,7 @@ Users/user/project/tsconfig.json: NOTE: TypeScript's "alwaysStrict" setting was }) } -func TestTsConfigWithStatementStrictTrueAlwaysStrictFalse(t *testing.T) { +func TestTsconfigWithStatementStrictTrueAlwaysStrictFalse(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/entry.ts": ` @@ -1779,7 +1779,7 @@ func TestTsConfigWithStatementStrictTrueAlwaysStrictFalse(t *testing.T) { }) } -func TestTsConfigAlwaysStrictTrueEmitDirectivePassThrough(t *testing.T) { +func TestTsconfigAlwaysStrictTrueEmitDirectivePassThrough(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/implicit.ts": ` @@ -1806,7 +1806,7 @@ func TestTsConfigAlwaysStrictTrueEmitDirectivePassThrough(t *testing.T) { }) } -func TestTsConfigAlwaysStrictTrueEmitDirectiveFormat(t *testing.T) { +func TestTsconfigAlwaysStrictTrueEmitDirectiveFormat(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/implicit.ts": ` @@ -1833,7 +1833,7 @@ func TestTsConfigAlwaysStrictTrueEmitDirectiveFormat(t *testing.T) { }) } -func TestTsConfigAlwaysStrictTrueEmitDirectiveBundleIIFE(t *testing.T) { +func TestTsconfigAlwaysStrictTrueEmitDirectiveBundleIIFE(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/implicit.ts": ` @@ -1861,7 +1861,7 @@ func TestTsConfigAlwaysStrictTrueEmitDirectiveBundleIIFE(t *testing.T) { }) } -func TestTsConfigAlwaysStrictTrueEmitDirectiveBundleCJS(t *testing.T) { +func TestTsconfigAlwaysStrictTrueEmitDirectiveBundleCJS(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/implicit.ts": ` @@ -1889,7 +1889,7 @@ func TestTsConfigAlwaysStrictTrueEmitDirectiveBundleCJS(t *testing.T) { }) } -func TestTsConfigAlwaysStrictTrueEmitDirectiveBundleESM(t *testing.T) { +func TestTsconfigAlwaysStrictTrueEmitDirectiveBundleESM(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/implicit.ts": ` @@ -1917,7 +1917,7 @@ func TestTsConfigAlwaysStrictTrueEmitDirectiveBundleESM(t *testing.T) { }) } -func TestTsConfigExtendsDotWithoutSlash(t *testing.T) { +func TestTsconfigExtendsDotWithoutSlash(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/main.tsx": ` @@ -1942,7 +1942,7 @@ func TestTsConfigExtendsDotWithoutSlash(t *testing.T) { }) } -func TestTsConfigExtendsDotDotWithoutSlash(t *testing.T) { +func TestTsconfigExtendsDotDotWithoutSlash(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/main.tsx": ` @@ -1966,7 +1966,7 @@ func TestTsConfigExtendsDotDotWithoutSlash(t *testing.T) { }) } -func TestTsConfigExtendsDotWithSlash(t *testing.T) { +func TestTsconfigExtendsDotWithSlash(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/main.tsx": ` @@ -1993,7 +1993,7 @@ func TestTsConfigExtendsDotWithSlash(t *testing.T) { }) } -func TestTsConfigExtendsDotDotWithSlash(t *testing.T) { +func TestTsconfigExtendsDotDotWithSlash(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/main.tsx": ` @@ -2019,7 +2019,7 @@ func TestTsConfigExtendsDotDotWithSlash(t *testing.T) { }) } -func TestTsConfigExtendsWithExports(t *testing.T) { +func TestTsconfigExtendsWithExports(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/main.tsx": ` @@ -2048,7 +2048,7 @@ func TestTsConfigExtendsWithExports(t *testing.T) { }) } -func TestTsConfigExtendsWithExportsStar(t *testing.T) { +func TestTsconfigExtendsWithExportsStar(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/main.tsx": ` @@ -2077,7 +2077,7 @@ func TestTsConfigExtendsWithExportsStar(t *testing.T) { }) } -func TestTsConfigExtendsWithExportsStarTrailing(t *testing.T) { +func TestTsconfigExtendsWithExportsStarTrailing(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/main.tsx": ` @@ -2106,7 +2106,7 @@ func TestTsConfigExtendsWithExportsStarTrailing(t *testing.T) { }) } -func TestTsConfigExtendsWithExportsRequire(t *testing.T) { +func TestTsconfigExtendsWithExportsRequire(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/main.tsx": ` @@ -2141,7 +2141,7 @@ func TestTsConfigExtendsWithExportsRequire(t *testing.T) { }) } -func TestTsConfigVerbatimModuleSyntaxTrue(t *testing.T) { +func TestTsconfigVerbatimModuleSyntaxTrue(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/main.ts": ` @@ -2167,7 +2167,7 @@ func TestTsConfigVerbatimModuleSyntaxTrue(t *testing.T) { }) } -func TestTsConfigVerbatimModuleSyntaxFalse(t *testing.T) { +func TestTsconfigVerbatimModuleSyntaxFalse(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/main.ts": ` @@ -2193,7 +2193,7 @@ func TestTsConfigVerbatimModuleSyntaxFalse(t *testing.T) { }) } -func TestTsConfigExtendsArray(t *testing.T) { +func TestTsconfigExtendsArray(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/main.tsx": ` @@ -2226,7 +2226,7 @@ func TestTsConfigExtendsArray(t *testing.T) { }) } -func TestTsConfigExtendsArrayNested(t *testing.T) { +func TestTsconfigExtendsArrayNested(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/main.tsx": ` @@ -2280,7 +2280,7 @@ func TestTsConfigExtendsArrayNested(t *testing.T) { }) } -func TestTsConfigIgnoreInsideNodeModules(t *testing.T) { +func TestTsconfigIgnoreInsideNodeModules(t *testing.T) { tsconfig_suite.expectBundled(t, bundled{ files: map[string]string{ "/Users/user/project/src/main.ts": ` diff --git a/internal/bundler_tests/snapshots/snapshots_tsconfig.txt b/internal/bundler_tests/snapshots/snapshots_tsconfig.txt index 6e3d2fa7009..29cba788315 100644 --- a/internal/bundler_tests/snapshots/snapshots_tsconfig.txt +++ b/internal/bundler_tests/snapshots/snapshots_tsconfig.txt @@ -14,7 +14,7 @@ var import_util = __toESM(require_util()); console.log((0, import_util.default)()); ================================================================================ -TestTsConfigAlwaysStrictTrueEmitDirectiveBundleCJS +TestTsconfigAlwaysStrictTrueEmitDirectiveBundleCJS ---------- /Users/user/project/out/implicit.js ---------- "use strict"; @@ -28,7 +28,7 @@ console.log('this file should start with "use strict"'); console.log('this file should start with "use strict"'); ================================================================================ -TestTsConfigAlwaysStrictTrueEmitDirectiveBundleESM +TestTsconfigAlwaysStrictTrueEmitDirectiveBundleESM ---------- /Users/user/project/out/implicit.js ---------- // Users/user/project/src/implicit.ts console.log('this file should not start with "use strict"'); @@ -38,7 +38,7 @@ console.log('this file should not start with "use strict"'); console.log('this file should not start with "use strict"'); ================================================================================ -TestTsConfigAlwaysStrictTrueEmitDirectiveBundleIIFE +TestTsconfigAlwaysStrictTrueEmitDirectiveBundleIIFE ---------- /Users/user/project/out/implicit.js ---------- "use strict"; (() => { @@ -54,7 +54,7 @@ TestTsConfigAlwaysStrictTrueEmitDirectiveBundleIIFE })(); ================================================================================ -TestTsConfigAlwaysStrictTrueEmitDirectiveFormat +TestTsconfigAlwaysStrictTrueEmitDirectiveFormat ---------- /Users/user/project/out/implicit.js ---------- "use strict"; console.log('this file should start with "use strict"'); @@ -64,7 +64,7 @@ console.log('this file should start with "use strict"'); console.log('this file should start with "use strict"'); ================================================================================ -TestTsConfigAlwaysStrictTrueEmitDirectivePassThrough +TestTsconfigAlwaysStrictTrueEmitDirectivePassThrough ---------- /Users/user/project/out/implicit.js ---------- "use strict"; console.log('this file should start with "use strict"'); @@ -74,7 +74,7 @@ console.log('this file should start with "use strict"'); console.log('this file should start with "use strict"'); ================================================================================ -TestTsConfigBaseURLExtendsPaths +TestTsconfigBaseURLExtendsPaths ---------- /Users/user/project/out.js ---------- // Users/user/project/lib/foo.ts var foo = 123; @@ -83,12 +83,12 @@ var foo = 123; console.log(foo); ================================================================================ -TestTsConfigExtendsArray +TestTsconfigExtendsArray ---------- /Users/user/project/out/main.js ---------- console.log(/* @__PURE__ */ h(frag, null, /* @__PURE__ */ h("div", null))); ================================================================================ -TestTsConfigExtendsArrayNested +TestTsconfigExtendsArrayNested ---------- /Users/user/project/out/main.js ---------- import { foo } from "foo"; export class Foo { @@ -98,55 +98,55 @@ export class Foo { } ================================================================================ -TestTsConfigExtendsDotDotWithSlash +TestTsconfigExtendsDotDotWithSlash ---------- /Users/user/project/out/main.js ---------- // Users/user/project/src/main.tsx console.log(/* @__PURE__ */ React.createElement("div", null)); ================================================================================ -TestTsConfigExtendsDotDotWithoutSlash +TestTsconfigExtendsDotDotWithoutSlash ---------- /Users/user/project/out/main.js ---------- // Users/user/project/src/main.tsx console.log(/* @__PURE__ */ success("div", null)); ================================================================================ -TestTsConfigExtendsDotWithSlash +TestTsconfigExtendsDotWithSlash ---------- /Users/user/project/out/main.js ---------- // Users/user/project/src/main.tsx console.log(/* @__PURE__ */ React.createElement("div", null)); ================================================================================ -TestTsConfigExtendsDotWithoutSlash +TestTsconfigExtendsDotWithoutSlash ---------- /Users/user/project/out/main.js ---------- // Users/user/project/src/main.tsx console.log(/* @__PURE__ */ success("div", null)); ================================================================================ -TestTsConfigExtendsWithExports +TestTsconfigExtendsWithExports ---------- /Users/user/project/out/main.js ---------- // Users/user/project/src/main.tsx console.log(/* @__PURE__ */ success("div", null)); ================================================================================ -TestTsConfigExtendsWithExportsRequire +TestTsconfigExtendsWithExportsRequire ---------- /Users/user/project/out/main.js ---------- // Users/user/project/src/main.tsx console.log(/* @__PURE__ */ success("div", null)); ================================================================================ -TestTsConfigExtendsWithExportsStar +TestTsconfigExtendsWithExportsStar ---------- /Users/user/project/out/main.js ---------- // Users/user/project/src/main.tsx console.log(/* @__PURE__ */ success("div", null)); ================================================================================ -TestTsConfigExtendsWithExportsStarTrailing +TestTsconfigExtendsWithExportsStarTrailing ---------- /Users/user/project/out/main.js ---------- // Users/user/project/src/main.tsx console.log(/* @__PURE__ */ success("div", null)); ================================================================================ -TestTsConfigIgnoreInsideNodeModules +TestTsconfigIgnoreInsideNodeModules ---------- /Users/user/project/out/main.js ---------- // Users/user/project/node_modules/pkg/index.js var foo = "foo"; @@ -173,13 +173,146 @@ if (bar3 !== "shimBar") throw "fail: shimBar"; ================================================================================ -TestTsConfigJSX +TestTsconfigIgnoredTargetSilent +---------- /Users/user/project/out.js ---------- + +================================================================================ +TestTsconfigImportsNotUsedAsValuesPreserve +---------- /Users/user/project/out.js ---------- +import "./foo"; +import "./foo"; +import "./foo"; +console.log(1, 2, 3); + +================================================================================ +TestTsconfigJSX ---------- /Users/user/project/out.js ---------- // Users/user/project/entry.tsx console.log(/* @__PURE__ */ R.c(R.F, null, /* @__PURE__ */ R.c("div", null), /* @__PURE__ */ R.c("div", null))); ================================================================================ -TestTsConfigNestedJSX +TestTsconfigJsonAbsoluteBaseUrl +---------- /Users/user/project/out.js ---------- +// Users/user/project/src/lib/util.js +var require_util = __commonJS({ + "Users/user/project/src/lib/util.js"(exports, module) { + module.exports = function() { + return 123; + }; + } +}); + +// Users/user/project/src/app/entry.js +var import_util = __toESM(require_util()); +console.log((0, import_util.default)()); + +================================================================================ +TestTsconfigJsonBaseUrl +---------- /Users/user/project/out.js ---------- +// Users/user/project/src/lib/util.js +var require_util = __commonJS({ + "Users/user/project/src/lib/util.js"(exports, module) { + module.exports = function() { + return 123; + }; + } +}); + +// Users/user/project/src/app/entry.js +var import_util = __toESM(require_util()); +console.log((0, import_util.default)()); + +================================================================================ +TestTsconfigJsonCommentAllowed +---------- /Users/user/project/out.js ---------- +// Users/user/project/src/lib/util.js +var require_util = __commonJS({ + "Users/user/project/src/lib/util.js"(exports, module) { + module.exports = function() { + return 123; + }; + } +}); + +// Users/user/project/src/app/entry.js +var import_util = __toESM(require_util()); +console.log((0, import_util.default)()); + +================================================================================ +TestTsconfigJsonExtends +---------- /out.js ---------- +// entry.jsx +console.log(/* @__PURE__ */ baseFactory("div", null), /* @__PURE__ */ baseFactory(derivedFragment, null)); + +================================================================================ +TestTsconfigJsonExtendsAbsolute +---------- /out.js ---------- +// Users/user/project/entry.jsx +console.log(/* @__PURE__ */ baseFactory("div", null), /* @__PURE__ */ baseFactory(derivedFragment, null)); + +================================================================================ +TestTsconfigJsonExtendsLoop +---------- /out.js ---------- +// entry.js +console.log(123); + +================================================================================ +TestTsconfigJsonExtendsPackage +---------- /Users/user/project/out.js ---------- +// Users/user/project/src/app/entry.jsx +console.log(/* @__PURE__ */ worked("div", null)); + +================================================================================ +TestTsconfigJsonExtendsThreeLevels +---------- /out.js ---------- +// Users/user/project/src/path2/works/import.js +console.log("works"); + +// Users/user/project/src/entry.jsx +console.log(/* @__PURE__ */ baseFactory("div", null), /* @__PURE__ */ baseFactory(derivedFragment, null)); + +================================================================================ +TestTsconfigJsonInsideNodeModules +---------- /Users/user/project/out.js ---------- +// Users/user/project/src/node_modules/foo/index.tsx +console.log(/* @__PURE__ */ React.createElement("div", null)); + +================================================================================ +TestTsconfigJsonNodeModulesImplicitFile +---------- /Users/user/project/out.js ---------- +// Users/user/project/src/app/entry.tsx +console.log(/* @__PURE__ */ worked("div", null)); + +================================================================================ +TestTsconfigJsonOverrideMissing +---------- /Users/user/project/out.js ---------- +// Users/user/project/other/foo-good.ts +console.log("good"); + +================================================================================ +TestTsconfigJsonOverrideNodeModules +---------- /Users/user/project/out.js ---------- +// Users/user/project/other/foo-good.ts +console.log("good"); + +================================================================================ +TestTsconfigJsonTrailingCommaAllowed +---------- /Users/user/project/out.js ---------- +// Users/user/project/src/lib/util.js +var require_util = __commonJS({ + "Users/user/project/src/lib/util.js"(exports, module) { + module.exports = function() { + return 123; + }; + } +}); + +// Users/user/project/src/app/entry.js +var import_util = __toESM(require_util()); +console.log((0, import_util.default)()); + +================================================================================ +TestTsconfigNestedJSX ---------- /Users/user/project/out.js ---------- // Users/user/project/factory/index.tsx var factory_default = /* @__PURE__ */ h(React.Fragment, null, /* @__PURE__ */ h("div", null), /* @__PURE__ */ h("div", null)); @@ -194,7 +327,7 @@ var both_default = /* @__PURE__ */ R.c(R.F, null, /* @__PURE__ */ R.c("div", nul console.log(factory_default, fragment_default, both_default); ================================================================================ -TestTsConfigPaths +TestTsconfigPaths ---------- /Users/user/project/out.js ---------- // Users/user/project/baseurl_dot/test0-success.ts var test0_success_default = "test0-success"; @@ -270,7 +403,7 @@ var baseurl_nested_default = { console.log(baseurl_dot_default, baseurl_nested_default); ================================================================================ -TestTsConfigPathsExtendsBaseURL +TestTsconfigPathsExtendsBaseURL ---------- /Users/user/project/out.js ---------- // Users/user/project/base/test/lib/foo.ts var foo = 123; @@ -279,7 +412,7 @@ var foo = 123; console.log(foo); ================================================================================ -TestTsConfigPathsInNodeModulesIssue2386 +TestTsconfigPathsInNodeModulesIssue2386 ---------- /Users/user/project/out.js ---------- // Users/user/project/node_modules/wow/dist/first.js var first_default = "dist"; @@ -291,7 +424,7 @@ var next_default = first_default; console.log(first_default, next_default); ================================================================================ -TestTsConfigPathsNoBaseURL +TestTsconfigPathsNoBaseURL ---------- /Users/user/project/out.js ---------- // Users/user/project/simple/test0-success.ts var test0_success_default = "test0-success"; @@ -361,7 +494,7 @@ var extended_default = { console.log(simple_default, extended_default); ================================================================================ -TestTsConfigPathsOverriddenBaseURL +TestTsconfigPathsOverriddenBaseURL ---------- /Users/user/project/out.js ---------- // Users/user/project/src/test.ts var test_default = 123; @@ -370,7 +503,7 @@ var test_default = 123; console.log(test_default); ================================================================================ -TestTsConfigPathsOverriddenBaseURLDifferentDir +TestTsconfigPathsOverriddenBaseURLDifferentDir ---------- /Users/user/project/out.js ---------- // Users/user/project/src/test.ts var test_default = 123; @@ -379,7 +512,7 @@ var test_default = 123; console.log(test_default); ================================================================================ -TestTsConfigPathsTypeOnly +TestTsconfigPathsTypeOnly ---------- /Users/user/project/out.js ---------- // Users/user/project/node_modules/fib/index.js function fib(input) { @@ -393,13 +526,13 @@ function fib(input) { console.log(fib(10)); ================================================================================ -TestTsConfigPreserveJSX +TestTsconfigPreserveJSX ---------- /Users/user/project/out.js ---------- // Users/user/project/entry.tsx console.log(/* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", null), /* @__PURE__ */ React.createElement("div", null))); ================================================================================ -TestTsConfigPreserveJSXAutomatic +TestTsconfigPreserveJSXAutomatic ---------- /Users/user/project/out.js ---------- // Users/user/project/entry.tsx import { Fragment, jsx, jsxs } from "react/jsx-runtime"; @@ -409,7 +542,40 @@ console.log(/* @__PURE__ */ jsxs(Fragment, { children: [ ] })); ================================================================================ -TestTsConfigReactJSX +TestTsconfigPreserveUnusedImports +---------- /Users/user/project/out.js ---------- +// Users/user/project/src/entry.ts +import "./src/foo"; +console.log(1); + +================================================================================ +TestTsconfigPreserveValueImports +---------- /Users/user/project/out.js ---------- +import { b1 } from "b"; +import { c1 } from "c"; +import { d1, d2 } from "d"; +import f1 from "f"; +import g1, { g2 } from "g"; +import h1 from "h"; +import * as i1 from "i"; +import "j"; + +================================================================================ +TestTsconfigPreserveValueImportsAndImportsNotUsedAsValuesPreserve +---------- /Users/user/project/out.js ---------- +import {} from "a"; +import { b1 } from "b"; +import { c1 } from "c"; +import { d1, d2 } from "d"; +import {} from "e"; +import f1, {} from "f"; +import g1, { g2 } from "g"; +import h1, {} from "h"; +import * as i1 from "i"; +import "j"; + +================================================================================ +TestTsconfigReactJSX ---------- /Users/user/project/out.js ---------- // Users/user/project/entry.tsx import { Fragment, jsx, jsxs } from "notreact/jsx-runtime"; @@ -419,7 +585,7 @@ console.log(/* @__PURE__ */ jsxs(Fragment, { children: [ ] })); ================================================================================ -TestTsConfigReactJSXDev +TestTsconfigReactJSXDev ---------- /Users/user/project/out.js ---------- // Users/user/project/entry.tsx import { Fragment, jsxDEV } from "react/jsx-dev-runtime"; @@ -441,7 +607,7 @@ console.log(/* @__PURE__ */ jsxDEV(Fragment, { children: [ }, this)); ================================================================================ -TestTsConfigReactJSXWithDevInMainConfig +TestTsconfigReactJSXWithDevInMainConfig ---------- /Users/user/project/out.js ---------- // Users/user/project/entry.tsx import { Fragment, jsxDEV } from "react/jsx-dev-runtime"; @@ -463,12 +629,40 @@ console.log(/* @__PURE__ */ jsxDEV(Fragment, { children: [ }, this)); ================================================================================ -TestTsConfigVerbatimModuleSyntaxFalse +TestTsconfigRemoveUnusedImports +---------- /Users/user/project/out.js ---------- +// Users/user/project/src/entry.ts +console.log(1); + +================================================================================ +TestTsconfigUnrecognizedTargetWarning +---------- /Users/user/project/out.js ---------- + +================================================================================ +TestTsconfigUseDefineForClassFieldsES2020 +---------- /Users/user/project/out.js ---------- +// Users/user/project/src/entry.ts +Foo = class { + constructor() { + this.useDefine = false; + } +}; + +================================================================================ +TestTsconfigUseDefineForClassFieldsESNext +---------- /Users/user/project/out.js ---------- +// Users/user/project/src/entry.ts +Foo = class { + useDefine = true; +}; + +================================================================================ +TestTsconfigVerbatimModuleSyntaxFalse ---------- /Users/user/project/out/main.js ---------- export { Car } from "./car"; ================================================================================ -TestTsConfigVerbatimModuleSyntaxTrue +TestTsconfigVerbatimModuleSyntaxTrue ---------- /Users/user/project/out/main.js ---------- export { Car } from "./car"; import {} from "./car"; @@ -477,7 +671,11 @@ import { b } from "bcd"; import {} from "xyz"; ================================================================================ -TestTsConfigWithStatementAlwaysStrictFalse +TestTsconfigWarningsInsideNodeModules +---------- /Users/user/project/out.js ---------- + +================================================================================ +TestTsconfigWithStatementAlwaysStrictFalse ---------- /Users/user/project/out.js ---------- (() => { // Users/user/project/src/entry.ts @@ -486,7 +684,7 @@ TestTsConfigWithStatementAlwaysStrictFalse })(); ================================================================================ -TestTsConfigWithStatementStrictFalse +TestTsconfigWithStatementStrictFalse ---------- /Users/user/project/out.js ---------- (() => { // Users/user/project/src/entry.ts @@ -495,208 +693,10 @@ TestTsConfigWithStatementStrictFalse })(); ================================================================================ -TestTsConfigWithStatementStrictTrueAlwaysStrictFalse +TestTsconfigWithStatementStrictTrueAlwaysStrictFalse ---------- /Users/user/project/out.js ---------- (() => { // Users/user/project/src/entry.ts with (x) y; })(); - -================================================================================ -TestTsconfigIgnoredTargetSilent ----------- /Users/user/project/out.js ---------- - -================================================================================ -TestTsconfigImportsNotUsedAsValuesPreserve ----------- /Users/user/project/out.js ---------- -import "./foo"; -import "./foo"; -import "./foo"; -console.log(1, 2, 3); - -================================================================================ -TestTsconfigJsonAbsoluteBaseUrl ----------- /Users/user/project/out.js ---------- -// Users/user/project/src/lib/util.js -var require_util = __commonJS({ - "Users/user/project/src/lib/util.js"(exports, module) { - module.exports = function() { - return 123; - }; - } -}); - -// Users/user/project/src/app/entry.js -var import_util = __toESM(require_util()); -console.log((0, import_util.default)()); - -================================================================================ -TestTsconfigJsonBaseUrl ----------- /Users/user/project/out.js ---------- -// Users/user/project/src/lib/util.js -var require_util = __commonJS({ - "Users/user/project/src/lib/util.js"(exports, module) { - module.exports = function() { - return 123; - }; - } -}); - -// Users/user/project/src/app/entry.js -var import_util = __toESM(require_util()); -console.log((0, import_util.default)()); - -================================================================================ -TestTsconfigJsonCommentAllowed ----------- /Users/user/project/out.js ---------- -// Users/user/project/src/lib/util.js -var require_util = __commonJS({ - "Users/user/project/src/lib/util.js"(exports, module) { - module.exports = function() { - return 123; - }; - } -}); - -// Users/user/project/src/app/entry.js -var import_util = __toESM(require_util()); -console.log((0, import_util.default)()); - -================================================================================ -TestTsconfigJsonExtends ----------- /out.js ---------- -// entry.jsx -console.log(/* @__PURE__ */ baseFactory("div", null), /* @__PURE__ */ baseFactory(derivedFragment, null)); - -================================================================================ -TestTsconfigJsonExtendsAbsolute ----------- /out.js ---------- -// Users/user/project/entry.jsx -console.log(/* @__PURE__ */ baseFactory("div", null), /* @__PURE__ */ baseFactory(derivedFragment, null)); - -================================================================================ -TestTsconfigJsonExtendsLoop ----------- /out.js ---------- -// entry.js -console.log(123); - -================================================================================ -TestTsconfigJsonExtendsPackage ----------- /Users/user/project/out.js ---------- -// Users/user/project/src/app/entry.jsx -console.log(/* @__PURE__ */ worked("div", null)); - -================================================================================ -TestTsconfigJsonExtendsThreeLevels ----------- /out.js ---------- -// Users/user/project/src/path2/works/import.js -console.log("works"); - -// Users/user/project/src/entry.jsx -console.log(/* @__PURE__ */ baseFactory("div", null), /* @__PURE__ */ baseFactory(derivedFragment, null)); - -================================================================================ -TestTsconfigJsonInsideNodeModules ----------- /Users/user/project/out.js ---------- -// Users/user/project/src/node_modules/foo/index.tsx -console.log(/* @__PURE__ */ React.createElement("div", null)); - -================================================================================ -TestTsconfigJsonNodeModulesImplicitFile ----------- /Users/user/project/out.js ---------- -// Users/user/project/src/app/entry.tsx -console.log(/* @__PURE__ */ worked("div", null)); - -================================================================================ -TestTsconfigJsonOverrideMissing ----------- /Users/user/project/out.js ---------- -// Users/user/project/other/foo-good.ts -console.log("good"); - -================================================================================ -TestTsconfigJsonOverrideNodeModules ----------- /Users/user/project/out.js ---------- -// Users/user/project/other/foo-good.ts -console.log("good"); - -================================================================================ -TestTsconfigJsonTrailingCommaAllowed ----------- /Users/user/project/out.js ---------- -// Users/user/project/src/lib/util.js -var require_util = __commonJS({ - "Users/user/project/src/lib/util.js"(exports, module) { - module.exports = function() { - return 123; - }; - } -}); - -// Users/user/project/src/app/entry.js -var import_util = __toESM(require_util()); -console.log((0, import_util.default)()); - -================================================================================ -TestTsconfigPreserveUnusedImports ----------- /Users/user/project/out.js ---------- -// Users/user/project/src/entry.ts -import "./src/foo"; -console.log(1); - -================================================================================ -TestTsconfigPreserveValueImports ----------- /Users/user/project/out.js ---------- -import { b1 } from "b"; -import { c1 } from "c"; -import { d1, d2 } from "d"; -import f1 from "f"; -import g1, { g2 } from "g"; -import h1 from "h"; -import * as i1 from "i"; -import "j"; - -================================================================================ -TestTsconfigPreserveValueImportsAndImportsNotUsedAsValuesPreserve ----------- /Users/user/project/out.js ---------- -import {} from "a"; -import { b1 } from "b"; -import { c1 } from "c"; -import { d1, d2 } from "d"; -import {} from "e"; -import f1, {} from "f"; -import g1, { g2 } from "g"; -import h1, {} from "h"; -import * as i1 from "i"; -import "j"; - -================================================================================ -TestTsconfigRemoveUnusedImports ----------- /Users/user/project/out.js ---------- -// Users/user/project/src/entry.ts -console.log(1); - -================================================================================ -TestTsconfigUnrecognizedTargetWarning ----------- /Users/user/project/out.js ---------- - -================================================================================ -TestTsconfigUseDefineForClassFieldsES2020 ----------- /Users/user/project/out.js ---------- -// Users/user/project/src/entry.ts -Foo = class { - constructor() { - this.useDefine = false; - } -}; - -================================================================================ -TestTsconfigUseDefineForClassFieldsESNext ----------- /Users/user/project/out.js ---------- -// Users/user/project/src/entry.ts -Foo = class { - useDefine = true; -}; - -================================================================================ -TestTsconfigWarningsInsideNodeModules ----------- /Users/user/project/out.js ----------