config

package
v0.0.0-...-5b7f1a8 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BuildTargets = map[string]api.Target{
		"es5":    api.ES5,
		"es2015": api.ES2015,
		"es2016": api.ES2016,
		"es2017": api.ES2017,
		"es2018": api.ES2018,
		"es2019": api.ES2019,
		"es2020": api.ES2020,
		"esnext": api.ESNext,
	}
	TargetNames = getTargetNames(BuildTargets)

	BuildEngines = map[string]api.EngineName{
		"chrome": api.EngineChrome,
		"ch":     api.EngineChrome,

		"firefox": api.EngineFirefox,
		"ff":      api.EngineFirefox,

		"edge": api.EngineEdge,

		"safari": api.EngineSafari,
		"sf":     api.EngineSafari,

		"node": api.EngineNode,
		"ios":  api.EngineIOS,
	}

	EngineNames = getEngineNames(BuildEngines)

	BuildFormats = map[string]api.Format{
		"iife": api.FormatIIFE,
		"cjs":  api.FormatCommonJS,
		"esm":  api.FormatESModule,
	}

	SourceMapTypes = map[string]api.SourceMap{
		"linked": api.SourceMapLinked,
		"inline": api.SourceMapInline,
	}

	FormatNames = getFormatNames(BuildFormats)
)

Functions

func ConfigureBuild

func ConfigureBuild(cfg *BuildOptions, pkgJson *pkgjson.PackageJSON) (*api.BuildOptions, error)

func ConfigureESMBuild

func ConfigureESMBuild(baseOpts *api.BuildOptions, pkgJson *pkgjson.PackageJSON) (*api.BuildOptions, error)

Types

type BuildOptions

type BuildOptions struct {
	Entry     string
	Target    string
	Engines   map[string]string
	Bundle    *bool
	Define    map[string]interface{}
	Format    string
	Minify    *bool
	SourceMap string
}

Jump to

Keyboard shortcuts

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