@shanzhai/minify-javascript-step

A Shanzhai step which minifies a Javascript file.

Usage no npm install needed!

<script type="module">
  import shanzhaiMinifyJavascriptStep from 'https://cdn.skypack.dev/@shanzhai/minify-javascript-step';
</script>

README

@shanzhai/minify-javascript-step Continuous Integration License FOSSA Status Renovate enabled npm npm type definitions

A Shanzhai step which minifies a Javascript file.

Usage

Within a trigger's event handler, return an instance of MinifyJavascriptStep similar to the following:

new MinifyJavascriptStep(
  `A description of the operation being performed`,
  new AnInputOfUnminifiedJavascript(),
  new AnInputOfAnObjectOfGlobalConstants(),
  new AnOutputOfMinifiedJavascript()
);

Configuration Notes

The configuration used is highly aggressive.

It assumes that no other script in the page needs any of top-level declarations, and leaves only object property minification disabled (due to its high risk of unexpected side effects).

Dependencies

This package has the following runtime dependencies:

Name Version
uglify-js 3.14.2

Peer Dependencies

This package has no runtime peer dependencies (it does not expect any other packages to be installed alongside itself).

License

FOSSA Status