Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanEscapeIdentifier ¶ added in v0.12.7
func QuoteForJSON ¶
Types ¶
type Options ¶ added in v0.8.12
type Options struct {
RequireOrImportMetaForSource func(uint32) RequireOrImportMeta
// Cross-module inlining of TypeScript enums is actually done during printing
TSEnums map[js_ast.Ref]map[string]js_ast.TSEnumValue
// This will be present if the input file had a source map. In that case we
// want to map all the way back to the original input file(s).
InputSourceMap *sourcemap.SourceMap
// If we're writing out a source map, this table of line start indices lets
// us do binary search on to figure out what line a given AST node came from
LineOffsetTables []sourcemap.LineOffsetTable
ToCommonJSRef js_ast.Ref
ToESMRef js_ast.Ref
RuntimeRequireRef js_ast.Ref
UnsupportedFeatures compat.JSFeature
Indent int
OutputFormat config.Format
RemoveWhitespace bool
MangleSyntax bool
ASCIIOnly bool
LegalComments config.LegalComments
AddSourceMappings bool
}
type PrintResult ¶
type PrintResult struct {
JS []byte
ExtractedLegalComments map[string]bool
// This source map chunk just contains the VLQ-encoded offsets for the "JS"
// field above. It's not a full source map. The bundler will be joining many
// source map chunks together to form the final source map.
SourceMapChunk sourcemap.Chunk
}
type RequireOrImportMeta ¶ added in v0.11.0
type RequireOrImportMeta struct {
// CommonJS files will return the "require_*" wrapper function and an invalid
// exports object reference. Lazily-initialized ESM files will return the
// "init_*" wrapper function and the exports object for that file.
WrapperRef js_ast.Ref
ExportsRef js_ast.Ref
IsWrapperAsync bool
}
Click to show internal directories.
Click to hide internal directories.