mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-27 04:48:33 -05:00
--moduleResolution bundler (formerly known as hybrid) (#51669)
* WIP * Add extension error back unless noEmit is set * Add non-relative tests * Add error for importing from declaration file * Update unit test * Add explicit flag for importing from .ts extensions * Add module specifier resolution changes * Add auto-import tests * Disallow relative imports into node_modules * Ensure auto-imports don’t suggest ./node_modules; * Test a non-portable declaration emit issue * Test auto-importing TSX file * Update path completions * Fix lint due to merge * Remove minimal-specific stuff * Remove minimal tests * Update unit tests * Add options * Add customConditions option * Add first tests * CJS constructs are not allowed * Add another test * Fix extension adding/replacing priority * Update test to reflect the choice not to block on unrecognized extensions * Add auto-imports and string completions tests * Revamp string completions ending preferences * Comment test * Auto-imports of declaration files cannot use .ts extension * Have declaration file auto imports default to extensionless instead * Add test for custom conditions * Fix indentation * Add baseline showing resolvePackageJsonImports/Exports compatibility * Fix test and prevent CJS require from resolving * Update unit test baselines * Fix bad merge conflict resolution * Make resolvedUsingTsExtension optional * Update missed baselines * Revert now-unnecessary API implementation changes * Clean up * Update baselines to es5 emit * Rename to `bundler`
This commit is contained in:
@@ -965,6 +965,7 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [
|
||||
classic: ModuleResolutionKind.Classic,
|
||||
node16: ModuleResolutionKind.Node16,
|
||||
nodenext: ModuleResolutionKind.NodeNext,
|
||||
bundler: ModuleResolutionKind.Bundler,
|
||||
})),
|
||||
affectsModuleResolution: true,
|
||||
paramType: Diagnostics.STRATEGY,
|
||||
@@ -1081,6 +1082,41 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [
|
||||
category: Diagnostics.Modules,
|
||||
description: Diagnostics.List_of_file_name_suffixes_to_search_when_resolving_a_module,
|
||||
},
|
||||
{
|
||||
name: "allowImportingTsExtensions",
|
||||
type: "boolean",
|
||||
affectsModuleResolution: true,
|
||||
category: Diagnostics.Modules,
|
||||
description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "resolvePackageJsonExports",
|
||||
type: "boolean",
|
||||
affectsModuleResolution: true,
|
||||
category: Diagnostics.Modules,
|
||||
description: Diagnostics.Use_the_package_json_exports_field_when_resolving_package_imports,
|
||||
defaultValueDescription: Diagnostics.true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false,
|
||||
},
|
||||
{
|
||||
name: "resolvePackageJsonImports",
|
||||
type: "boolean",
|
||||
affectsModuleResolution: true,
|
||||
category: Diagnostics.Modules,
|
||||
description: Diagnostics.Use_the_package_json_imports_field_when_resolving_imports,
|
||||
defaultValueDescription: Diagnostics.true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false,
|
||||
},
|
||||
{
|
||||
name: "customConditions",
|
||||
type: "list",
|
||||
element: {
|
||||
name: "condition",
|
||||
type: "string",
|
||||
},
|
||||
affectsModuleResolution: true,
|
||||
category: Diagnostics.Modules,
|
||||
description: Diagnostics.Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports,
|
||||
},
|
||||
|
||||
// Source Maps
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user