Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface GeneratorOptions

Hierarchy

  • GeneratorOptions

Index

Properties

Optional auxiliaryCommentAfter

auxiliaryCommentAfter: undefined | string

Optional string to add as a block comment at the end of the output file.

Optional auxiliaryCommentBefore

auxiliaryCommentBefore: undefined | string

Optional string to add as a block comment at the start of the output file.

Optional comments

comments: undefined | false | true

Should comments be included in output? Defaults to true.

Optional compact

compact: boolean | "auto"

Set to true to avoid adding whitespace for formatting. Defaults to the value of opts.minified.

Optional concise

concise: undefined | false | true

Set to true to reduce whitespace (but not as much as opts.compact). Defaults to false.

Optional decoratorsBeforeExport

decoratorsBeforeExport: undefined | false | true

Set to true to enable support for experimental decorators syntax before module exports. Defaults to false.

Optional filename

filename: undefined | string

Used in warning messages

Optional jsescOption

jsescOption: undefined | { compact?: undefined | false | true; es6?: undefined | false | true; escapeEverything?: undefined | false | true; indent?: undefined | string; indentLevel?: undefined | number; isScriptContext?: undefined | false | true; json?: undefined | false | true; lowercaseHex?: undefined | false | true; minimal?: undefined | false | true; numbers?: "binary" | "octal" | "decimal" | "hexadecimal"; quotes?: "single" | "double" | "backtick"; wrap?: undefined | false | true }

Options for outputting jsesc representation.

Optional jsonCompatibleStrings

jsonCompatibleStrings: undefined | false | true

Set to true to run jsesc with "json": true to print "\u00A9" vs. "©";

Optional minified

minified: undefined | false | true

Should the output be minified. Defaults to false.

Optional retainFunctionParens

retainFunctionParens: undefined | false | true

Retain parens around function expressions (could be used to change engine parsing behavior) Defaults to false.

Optional retainLines

retainLines: undefined | false | true

Attempt to use the same line numbers in the output code as in the source code (helps preserve stack traces). Defaults to false.

Optional sourceFileName

sourceFileName: undefined | string

The filename for the source code (i.e. the code in the code argument). This will only be used if code is a string.

Optional sourceMaps

sourceMaps: undefined | false | true

Enable generating source maps. Defaults to false.

Optional sourceRoot

sourceRoot: undefined | string

A root for all relative URLs in the source map.

Methods

Optional shouldPrintComment

  • shouldPrintComment(comment: string): boolean
  • Function that takes a comment (as a string) and returns true if the comment should be included in the output. By default, comments are included if opts.comments is true or if opts.minifed is false and the comment contains @preserve or @license.

    Parameters

    • comment: string

    Returns boolean