package cache

import "github.com/evanw/esbuild/internal/cache"

Index

Types

type CSSCache

type CSSCache struct {
	// contains filtered or unexported fields
}

func (*CSSCache) Parse

func (c *CSSCache) Parse(log logger.Log, source logger.Source, options css_parser.Options) css_ast.AST

type CacheSet

type CacheSet struct {
	FSCache          FSCache
	CSSCache         CSSCache
	JSONCache        JSONCache
	JSCache          JSCache
	SourceIndexCache SourceIndexCache
}

This is a cache of the parsed contents of a set of files. The idea is to be able to reuse the results of parsing between builds and make subsequent builds faster by avoiding redundant parsing work. This only works if:

func MakeCacheSet

func MakeCacheSet() *CacheSet

type FSCache

type FSCache struct {
	// contains filtered or unexported fields
}

func (*FSCache) ReadFile

func (c *FSCache) ReadFile(fs fs.FS, path string) (contents string, canonicalError error, originalError error)

type JSCache

type JSCache struct {
	// contains filtered or unexported fields
}

func (*JSCache) Parse

func (c *JSCache) Parse(log logger.Log, source logger.Source, options js_parser.Options) (js_ast.AST, bool)

type JSONCache

type JSONCache struct {
	// contains filtered or unexported fields
}

func (*JSONCache) Parse

func (c *JSONCache) Parse(log logger.Log, source logger.Source, options js_parser.JSONOptions) (js_ast.Expr, bool)

type SourceIndexCache

type SourceIndexCache struct {
	// contains filtered or unexported fields
}

func (*SourceIndexCache) Get

func (c *SourceIndexCache) Get(path logger.Path, kind SourceIndexKind) uint32

func (*SourceIndexCache) GetGlob

func (c *SourceIndexCache) GetGlob(parentSourceIndex uint32, globIndex uint32) uint32

func (*SourceIndexCache) LenHint

func (c *SourceIndexCache) LenHint() uint32

type SourceIndexKind

type SourceIndexKind uint8
const (
	SourceIndexNormal SourceIndexKind = iota
	SourceIndexJSStubForCSS
)

Source Files

cache.go cache_ast.go cache_fs.go

Version
v0.25.0 (latest)
Published
Feb 8, 2025
Platform
linux/amd64
Imports
8 packages
Last checked
4 days ago

Tools for package owners.