bundler

package
v0.5.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultExtensionToLoaderMap

func DefaultExtensionToLoaderMap() map[string]Loader

Types

type Bundle

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

func ScanBundle

func ScanBundle(
	log logging.Log, fs fs.FS, res resolver.Resolver, entryPaths []string,
	parseOptions parser.ParseOptions, bundleOptions BundleOptions,
) Bundle

func (*Bundle) Compile

func (b *Bundle) Compile(log logging.Log, options BundleOptions) []OutputFile

type BundleOptions

type BundleOptions struct {
	// true: imports are scanned and bundled along with the file
	// false: imports are left alone and the file is passed through as-is
	IsBundling bool

	AbsOutputFile     string
	AbsOutputDir      string
	RemoveWhitespace  bool
	MinifyIdentifiers bool
	MangleSyntax      bool
	ModuleName        string
	ExtensionToLoader map[string]Loader
	OutputFormat      printer.Format

	// If present, metadata about the bundle is written as JSON here
	AbsMetadataFile string

	SourceMap SourceMap
	Stdin     *StdinInfo

	// If true, make sure to generate a single file that can be written to stdout
	WriteToStdout bool
	// contains filtered or unexported fields
}

type Loader

type Loader int
const (
	LoaderNone Loader = iota
	LoaderJS
	LoaderJSX
	LoaderTS
	LoaderTSX
	LoaderJSON
	LoaderText
	LoaderBase64
	LoaderDataURL
	LoaderFile
)

type OutputFile added in v0.4.4

type OutputFile struct {
	AbsPath  string
	Contents []byte
	// contains filtered or unexported fields
}

type SourceMap added in v0.3.2

type SourceMap uint8
const (
	SourceMapNone SourceMap = iota
	SourceMapInline
	SourceMapLinkedWithComment
	SourceMapExternalWithoutComment
)

type StdinInfo added in v0.5.0

type StdinInfo struct {
	Loader     Loader
	Contents   string
	SourceFile string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL