minify

package
v1.6.10 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: ISC Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Literals = 1 << iota
	ArrowFn
	IfToConditional
	RemoveDebugger
	RenameIdentifiers
	BlocksToStatement
	Keys
	RemoveExpressionNames
	FunctionExpressionToArrowFunc
	UnwrapParens
	RemoveLastEmptyReturn
	CombineExpressionRuns
	RemoveDeadCode
	MergeLexical

	Safe = Literals | ArrowFn | IfToConditional | RemoveDebugger | RenameIdentifiers | BlocksToStatement | Keys | RemoveExpressionNames | FunctionExpressionToArrowFunc | UnwrapParens | RemoveLastEmptyReturn | CombineExpressionRuns | RemoveDeadCode | MergeLexical
)

Variables

View Source
var ErrInvalidAST = errors.New("invalid AST")

Functions

func Print

func Print(w io.Writer, m *javascript.Module) (int64, error)

Types

type Minifier

type Minifier struct {
	Option
}

func New

func New(opts ...Option) *Minifier

func (*Minifier) Process

func (m *Minifier) Process(jm *javascript.Module)

type Option

type Option uint64

func (Option) Has

func (o Option) Has(opt Option) bool

Jump to

Keyboard shortcuts

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