Documentation ¶
Index ¶
- func DefaultExtensionToLoaderMap() map[string]config.Loader
- func HashForFileName(hashBytes []byte) string
- func PathRelativeToOutbase(inputFile *graph.InputFile, options *config.Options, fs fs.FS, avoidIndex bool, ...) (relDir string, baseName string)
- func ResolveFailureErrorTextSuggestionNotes(res *resolver.Resolver, path string, kind ast.ImportKind, pluginName string, ...) (text string, suggestion string, notes []logger.MsgData)
- func RunOnResolvePlugins(plugins []config.Plugin, res *resolver.Resolver, log logger.Log, fs fs.FS, ...) (*resolver.ResolveResult, bool, resolver.DebugMeta)
- type Bundle
- type DataForSourceMap
- type EntryPoint
- type Linker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashForFileName ¶ added in v0.16.8
func PathRelativeToOutbase ¶ added in v0.16.8
func PathRelativeToOutbase( inputFile *graph.InputFile, options *config.Options, fs fs.FS, avoidIndex bool, customFilePath string, ) (relDir string, baseName string)
Returns the path of this file relative to "outbase", which is then ready to be joined with the absolute output directory path. The directory and name components are returned separately for convenience.
func ResolveFailureErrorTextSuggestionNotes ¶ added in v0.14.30
func RunOnResolvePlugins ¶ added in v0.14.8
func RunOnResolvePlugins( plugins []config.Plugin, res *resolver.Resolver, log logger.Log, fs fs.FS, fsCache *cache.FSCache, importSource *logger.Source, importPathRange logger.Range, importer logger.Path, path string, kind ast.ImportKind, absResolveDir string, pluginData interface{}, ) (*resolver.ResolveResult, bool, resolver.DebugMeta)
Types ¶
type Bundle ¶
type Bundle struct {
// contains filtered or unexported fields
}
func ScanBundle ¶
func ScanBundle( log logger.Log, fs fs.FS, caches *cache.CacheSet, entryPoints []EntryPoint, options config.Options, timer *helpers.Timer, ) Bundle
This creates a bundle by scanning over the whole module graph starting from the entry points until all modules are reached. Each module has some number of import paths which are resolved to module identifiers (i.e. "onResolve" in the plugin API). Each unique module identifier is loaded once (i.e. "onLoad" in the plugin API).
type DataForSourceMap ¶ added in v0.16.8
type DataForSourceMap struct { // This data is for the printer. It maps from byte offsets in the file (which // are stored at every AST node) to UTF-16 column offsets (required by source // maps). LineOffsetTables []sourcemap.LineOffsetTable // This contains the quoted contents of the original source file. It's what // needs to be embedded in the "sourcesContent" array in the final source // map. Quoting is precomputed because it's somewhat expensive. QuotedContents [][]byte }
This is data related to source maps. It's computed in parallel with linking and must be ready by the time printing happens. This is beneficial because it is somewhat expensive to produce.