package config

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

Dependency Relation
	imports 9 packages, and imported by 5 packages

Involved Source Files config.go globals.go
Package-Level Type Names (total 30, all are exported)
/* sort exporteds by: | */
FindSymbol func(logger.Loc, string) js_ast.Ref Loc logger.Loc SymbolForDefine func(int) js_ast.Ref
True if a call to this value is known to not have any side effects. For example, a bare call to "Object()" can be removed because it does not have any observable side effects. True if accessing this value is known to not have any side effects. For example, a bare reference to "Object.create" can be removed because it does not have any observable side effects. DefineFunc DefineFunc Set to true to warn users that this should be defined if it's not already. func ProcessDefines(userDefines map[string]DefineData) ProcessedDefines
Data DefineData Parts []string
AbsPaths map[string]bool NodeModules map[string]bool Patterns []WildcardPattern
( T) KeepES6ImportExportSyntax() bool ( T) String() string T : expvar.Var T : fmt.Stringer func IsTreeShakingEnabled(mode Mode, outputFormat Format) bool const FormatCommonJS const FormatESModule const FormatIIFE const FormatPreserve
Data js_ast.E Name string Source logger.Source
Exports []string IsDefine bool Path string SourceIndex uint32
Factory []string Fragment []string Parse bool
type LanguageTarget int8 (basic type)
( T) CanHaveSourceMap() bool ( T) IsTypeScript() bool func github.com/evanw/esbuild/internal/bundler.DefaultExtensionToLoaderMap() map[string]Loader const LoaderBase64 const LoaderBinary const LoaderCSS const LoaderDataURL const LoaderDefault const LoaderFile const LoaderJS const LoaderJSON const LoaderJSX const LoaderNone const LoaderText const LoaderTS const LoaderTSX
func IsTreeShakingEnabled(mode Mode, outputFormat Format) bool const ModeBundle const ModeConvertFormat const ModePassThrough
Callback func(OnLoadArgs) OnLoadResult Filter *regexp.Regexp Name string Namespace string
Path logger.Path PluginData interface{}
Callback func(OnResolveArgs) OnResolveResult Filter *regexp.Regexp Name string Namespace string
Importer logger.Path Kind ast.ImportKind Path string PluginData interface{} ResolveDir string
External bool Msgs []logger.Msg Path logger.Path PluginData interface{} PluginName string ThrownError error
ASCIIOnly bool If present, metadata about the bundle is written as JSON here // The "NODE_PATH" variable from Node.js AbsOutputBase string AbsOutputDir string AbsOutputFile string AssetPathTemplate []PathTemplate Banner string ChunkPathTemplate []PathTemplate CodeSplitting bool Defines *ProcessedDefines ExcludeSourcesContent bool ExtensionOrder []string ExtensionToLoader map[string]Loader ExternalModules ExternalModules Footer string GlobalName []string IgnoreDCEAnnotations bool InjectAbsPaths []string InjectedDefines []InjectedDefine InjectedFiles []InjectedFile JSX JSXOptions KeepNames bool MainFields []string MangleSyntax bool MinifyIdentifiers bool Mode Mode OmitRuntimeForTests bool OutputExtensionCSS string OutputExtensionJS string OutputFormat Format Platform Platform Plugins []Plugin PreserveSymlinks bool PreserveUnusedImportsTS bool PublicPath string RemoveWhitespace bool SourceMap SourceMap Stdin *StdinInfo Setting this to true disables warnings about code that is very likely to be a bug. This is used to ignore issues inside "node_modules" directories. This has caught real issues in the past. However, it's not esbuild's job to find bugs in other libraries, and these warnings are problematic for people using these libraries with esbuild. The only fix is to either disable all esbuild warnings and not get warnings about your own code, or to try to get the warning fixed in the affected library. This is especially annoying if the warning is a false positive as was the case in https://github.com/firebase/firebase-js-sdk/issues/3814. So these warnings are now disabled for code inside "node_modules" directories. TS TSOptions TsConfigOverride string UnsupportedCSSFeatures compat.CSSFeature UnsupportedJSFeatures compat.JSFeature UseDefineForClassFields bool WatchMode bool If true, make sure to generate a single file that can be written to stdout func github.com/evanw/esbuild/internal/bundler.ScanBundle(log logger.Log, fs fs.FS, res resolver.Resolver, caches *cache.CacheSet, entryPoints []string, options Options) bundler.Bundle func github.com/evanw/esbuild/internal/bundler.(*Bundle).Compile(log logger.Log, options Options) []bundler.OutputFile func github.com/evanw/esbuild/internal/js_parser.OptionsFromConfig(options *Options) js_parser.Options func github.com/evanw/esbuild/internal/resolver.NewResolver(fs fs.FS, log logger.Log, caches *cache.CacheSet, options Options) resolver.Resolver
func HasPlaceholder(template []PathTemplate, placeholder PathPlaceholder) bool func PathPlaceholders.Get(placeholder PathPlaceholder) *string const HashPlaceholder const NamePlaceholder const NoPlaceholder
Hash *string Name *string ( T) Get(placeholder PathPlaceholder) *string func SubstituteTemplate(template []PathTemplate, placeholders PathPlaceholders) []PathTemplate
Data string Placeholder PathPlaceholder func SubstituteTemplate(template []PathTemplate, placeholders PathPlaceholders) []PathTemplate func HasPlaceholder(template []PathTemplate, placeholder PathPlaceholder) bool func SubstituteTemplate(template []PathTemplate, placeholders PathPlaceholders) []PathTemplate func TemplateToString(template []PathTemplate) string
const PlatformBrowser const PlatformNeutral const PlatformNode
Name string OnLoad []OnLoad OnResolve []OnResolve
DotDefines map[string][]DotDefine IdentifierDefines map[string]DefineData func ProcessDefines(userDefines map[string]DefineData) ProcessedDefines
const SourceMapExternalWithoutComment const SourceMapInline const SourceMapInlineAndExternal const SourceMapLinkedWithComment const SourceMapNone
AbsResolveDir string Contents string Loader Loader SourceFile string
Loose: "class Foo { foo = 1 }" => "class Foo { constructor() { this.foo = 1; } }" Strict: "class Foo { foo = 1 }" => "class Foo { constructor() { __publicField(this, 'foo', 1); } }" The disadvantage of strictness here is code bloat and performance. The advantage is following the class field specification accurately. For example, loose mode will incorrectly trigger setter methods while strict mode won't.
Parse bool
Prefix string Suffix string
Package-Level Functions (total 10, in which 7 are exported)
This transformation is expensive, so we only want to do it once. Make sure to only call processDefines() once per compilation. Unfortunately Golang doesn't have an efficient way to copy a map and the overhead of copying all of the properties into a new map once for every new parser noticeably slows down our benchmarks.
Package-Level Variables (total 5, none are exported)
Package-Level Constants (total 31, all are exported)
The CommonJS format looks like this: ... bundled code ... module.exports = exports;
The ES module format looks like this: ... bundled code ... export {...};
IIFE stands for immediately-invoked function expression. That looks like this: (() => { ... bundled code ... })(); If the optional GlobalName is configured, then we'll write out this: let globalName = (() => { ... bundled code ... return exports; })();
This is used when not bundling. It means to preserve whatever form the import or export was originally in. ES6 syntax stays ES6 syntax and CommonJS syntax stays CommonJS syntax.
A hash of the contents of this file, and the contents and output paths of all dependencies (except for their hash placeholders)
The original name of the file, or the manual chunk name, or the name of the type of output file ("entry" or "chunk" or "asset")