Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 1.12 KB

terser.md

File metadata and controls

39 lines (27 loc) · 1.12 KB

Terser Extension

Task Definitions: None
Template Definitions: 'terser'
Batcher Defintions: None

Performs a single-file Terser minification.

Terser Template

Template Options

  • auto-install (Boolean, default: true): Whether to automatically install terser with npm if not present (using the npm extension). The global npm extension auto-install option will take precedence here if not otherwise set.
  • ...terserOptions. Options are exactly per Terser documentation, as kabab-case keys per Chomp serialization conventions.

Example

chompfile.toml

version = 0.1

extensions = ['[email protected]:terser']

[[task]]
name = 'test'
target = 'dist/app.js'
dep = 'dist/app.min.js'
template = 'terser'
[task.template-options]
module = true
compress = { ecma = 6, unsafe = true }
source-maps = true

When using source-maps, the sourceURL comment and sources content will be automatically enabled by the extension.

Ejection

When ejecting the template, the JS Terser API usage will be ejected, without auto-installation.