package config
Import Path
github.com/evanw/esbuild/internal/config (on go.dev)
Dependency Relation
imports 9 packages, and imported by 5 packages
Package-Level Type Names (total 30, all are exported)
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 mergeDefineData(old DefineData, new DefineData) DefineData
func ProcessDefines(userDefines map[string]DefineData) ProcessedDefines
func mergeDefineData(old DefineData, new DefineData) DefineData
func mergeDefineData(old DefineData, new DefineData) DefineData
type DefineFunc (func)
AbsPaths map[string]bool
NodeModules map[string]bool
Patterns []WildcardPattern
func github.com/evanw/esbuild/pkg/api.validateExternals(log logger.Log, fs fs.FS, paths []string) ExternalModules
( T) KeepES6ImportExportSyntax() bool
( T) String() string
T : expvar.Var
T : fmt.Stringer
T : context.stringer
T : runtime.stringer
func github.com/evanw/esbuild/pkg/api.validateFormat(value api.Format) Format
func IsTreeShakingEnabled(mode Mode, outputFormat Format) bool
const FormatCommonJS
const FormatESModule
const FormatIIFE
const FormatPreserve
Data js_ast.E
Name string
Source logger.Source
func github.com/evanw/esbuild/pkg/api.validateDefines(log logger.Log, defines map[string]string, pureFns []string) (*ProcessedDefines, []InjectedDefine)
type LanguageTarget int8 (basic type)
( T) CanHaveSourceMap() bool
( T) IsTypeScript() bool
func github.com/evanw/esbuild/internal/bundler.DefaultExtensionToLoaderMap() map[string]Loader
func github.com/evanw/esbuild/internal/bundler.loaderFromFileExtension(extensionToLoader map[string]Loader, base string) Loader
func github.com/evanw/esbuild/pkg/api.validateLoader(value api.Loader) Loader
func github.com/evanw/esbuild/pkg/api.validateLoaders(log logger.Log, loaders map[string]api.Loader) map[string]Loader
func github.com/evanw/esbuild/internal/bundler.loaderFromFileExtension(extensionToLoader map[string]Loader, base 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
Path logger.Path
PluginData interface{}
AbsResolveDir string
Contents *string
Loader Loader
Msgs []logger.Msg
PluginData interface{}
PluginName string
ThrownError error
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 github.com/evanw/esbuild/internal/bundler.applyOptionDefaults(options *Options)
func github.com/evanw/esbuild/internal/bundler.newLinkerContext(options *Options, log logger.Log, fs fs.FS, res resolver.Resolver, files []bundler.file, entryPoints []uint32, reachableFiles []uint32, dataForSourceMaps func() []bundler.dataForSourceMap) bundler.linkerContext
func github.com/evanw/esbuild/internal/bundler.(*Bundle).computeDataForSourceMapsInParallel(options *Options, reachableFiles []uint32) func() []bundler.dataForSourceMap
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 github.com/evanw/esbuild/pkg/api.validatePathTemplate(template string) []PathTemplate
func HasPlaceholder(template []PathTemplate, placeholder PathPlaceholder) bool
func SubstituteTemplate(template []PathTemplate, placeholders PathPlaceholders) []PathTemplate
func TemplateToString(template []PathTemplate) string
func github.com/evanw/esbuild/pkg/api.validatePlatform(value api.Platform) Platform
const PlatformBrowser
const PlatformNeutral
const PlatformNode
Name string
OnLoad []OnLoad
OnResolve []OnResolve
func github.com/evanw/esbuild/pkg/api.loadPlugins(fs fs.FS, log logger.Log, plugins []api.Plugin) (results []Plugin)
func github.com/evanw/esbuild/internal/bundler.runOnLoadPlugins(plugins []Plugin, res resolver.Resolver, fs fs.FS, fsCache *cache.FSCache, log logger.Log, source *logger.Source, importSource *logger.Source, importPathRange logger.Range, pluginData interface{}, isWatchMode bool) (bundler.loaderPluginResult, bool)
func github.com/evanw/esbuild/internal/bundler.runOnResolvePlugins(plugins []Plugin, res resolver.Resolver, log logger.Log, fs fs.FS, importSource *logger.Source, importPathRange logger.Range, path string, kind ast.ImportKind, absResolveDir string, pluginData interface{}) (*resolver.ResolveResult, bool)
func github.com/evanw/esbuild/pkg/api.rebuildImpl(buildOpts api.BuildOptions, caches *cache.CacheSet, plugins []Plugin, logOptions logger.OutputOptions, log logger.Log, isRebuild bool) api.internalBuildResult
DotDefines map[string][]DotDefine
IdentifierDefines map[string]DefineData
func ProcessDefines(userDefines map[string]DefineData) ProcessedDefines
func github.com/evanw/esbuild/pkg/api.validateDefines(log logger.Log, defines map[string]string, pureFns []string) (*ProcessedDefines, []InjectedDefine)
var processedGlobals *ProcessedDefines
func github.com/evanw/esbuild/pkg/api.validateSourceMap(value api.SourceMap) SourceMap
const SourceMapExternalWithoutComment
const SourceMapInline
const SourceMapInlineAndExternal
const SourceMapLinkedWithComment
const SourceMapNone
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.
Package-Level Functions (total 10, in which 7 are exported)
func HasPlaceholder(template []PathTemplate, placeholder PathPlaceholder) bool func IsTreeShakingEnabled(mode Mode, outputFormat Format) bool
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.
func SubstituteTemplate(template []PathTemplate, placeholders PathPlaceholders) []PathTemplate func TemplateToString(template []PathTemplate) string
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)
const LoaderBase64 Loader = 7 const LoaderBinary Loader = 10 const LoaderDataURL Loader = 8 const LoaderDefault Loader = 12 const LoaderFile Loader = 9 const LoaderJSON Loader = 5 const LoaderNone Loader = 0 const LoaderText Loader = 6 const ModeBundle Mode = 2 const ModePassThrough Mode = 0
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")
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |