package resolver

Import Path
	github.com/evanw/esbuild/internal/resolver (on go.dev)

Dependency Relation
	imports 16 packages, and imported by 2 packages


Package-Level Type Names (total 10, in which 7 are exported)
/* sort exporteds by: | */
( T) DecodeData() (string, error) ( T) DecodeMIMEType() MIMEType func ParseDataURL(url string) (parsed DataURL, ok bool)
If true, "sideEffects" was an array. If false, "sideEffects" was false. Range logger.Range Source *logger.Source
func DataURL.DecodeMIMEType() MIMEType const MIMETypeApplicationJSON const MIMETypeTextCSS const MIMETypeTextJavaScript const MIMETypeUnsupported
Path resolution is a mess. One tricky issue is the "module" override for the "main" field in "package.json" files. Bundlers generally prefer "module" over "main" but that breaks packages that export a function in "main" for use with "require()", since resolving to "module" means an object will be returned. We attempt to handle this automatically by having import statements resolve to "module" but switch that out later for "main" if "require()" is used too. Either secondary will be empty, or primary will be "module" and secondary will be "main" Secondary logger.Path (*T) HasSecondary() bool
( T) PrettyPath(path logger.Path) string This tries to run "Resolve" on a package path as a relative path. If successful, the user just forgot a leading "./" in front of the path. ( T) Resolve(sourceDir string, importPath string, kind ast.ImportKind) *ResolveResult ( T) ResolveAbs(absPath string) *ResolveResult func NewResolver(fs fs.FS, log logger.Log, caches *cache.CacheSet, options config.Options) Resolver func github.com/evanw/esbuild/internal/bundler.ScanBundle(log logger.Log, fs fs.FS, res Resolver, caches *cache.CacheSet, entryPoints []string, options config.Options) bundler.Bundle
DifferentCase *fs.DifferentCase If true, any ES6 imports to this file can be considered to have no side effects. This means they should be removed if unused. IsExternal bool If not empty, these should override the default values // Default if empty: "React.createElement" // Default if empty: "React.Fragment" PathPair PathPair If this was resolved by a plugin, the plugin gets to store its data here If true, unused imports are retained in TypeScript code. This matches the behavior of the "importsNotUsedAsValues" field in "tsconfig.json" when the value is not "remove". If true, the class field transform should use Object.defineProperty(). func Resolver.ProbeResolvePackageAsRelative(sourceDir string, importPath string, kind ast.ImportKind) *ResolveResult func Resolver.Resolve(sourceDir string, importPath string, kind ast.ImportKind) *ResolveResult func Resolver.ResolveAbs(absPath string) *ResolveResult
The absolute path of "compilerOptions.baseUrl" This is used if "Paths" is non-nil. It's equal to "BaseURL" except if "BaseURL" is missing, in which case it is as if "BaseURL" was ".". This is to implement the "paths without baseUrl" feature from TypeScript 4.1. More info: https://github.com/microsoft/TypeScript/issues/31869 JSXFactory []string JSXFragmentFactory []string The verbatim values of "compilerOptions.paths". The keys are patterns to match and the values are arrays of fallback paths to search. Each key and each fallback path can optionally have a single "*" wildcard character. If both the key and the value have a wildcard, the substring matched by the wildcard is substituted into the fallback path. The keys represent module-style path names and the fallback paths are relative to the "baseUrl" value in the "tsconfig.json" file. PreserveImportsNotUsedAsValues bool UseDefineForClassFields bool func ParseTSConfigJSON(log logger.Log, source logger.Source, jsonCache *cache.JSONCache, extends func(string, logger.Range) *TSConfigJSON) *TSConfigJSON
Package-Level Functions (total 13, in which 5 are exported)
Package paths are loaded from a "node_modules" directory. Non-package paths are relative or absolute paths.
func ParseDataURL(url string) (parsed DataURL, ok bool)
Package-Level Variables (total 4, in which 1 are exported)