Skip to content

Commit

Permalink
terser: new package (#36902)
Browse files Browse the repository at this point in the history
#### For new package PRs only
- [x] REQUIRED - The package is available under an OSI-approved or
FSF-approved license
- [x] REQUIRED - The version of the package is still receiving security
updates

Signed-off-by: Massimiliano Giovagnoli <[email protected]>
  • Loading branch information
maxgio92 authored Dec 13, 2024
1 parent d174551 commit 5c08e52
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions terser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package:
name: terser
version: 5.37.0
epoch: 0
description: A JavaScript mangler/compressor toolkit for ES6+.
copyright:
- license: MIT

environment:
contents:
packages:
- npm

vars:
prefix: /usr/local

pipeline:
- name: npm install
uses: npm/install
with:
package: terser
prefix: ${{targets.contextdir}}/${{vars.prefix}}
version: ${{package.version}}

- uses: strip

test:
environment:
contents:
packages:
- bash
- nodejs
- npm
pipeline:
- name: Verify Terser version
runs: |
terser --version | grep "${{package.version}}" || (echo "Version mismatch!" && exit 1)
- name: Compress JS file using terser
runs: |
echo "function add(a, b) { return a + b; }" > test.js
terser test.js --compress ecma=2015,computed_props=false -o test.min.js
- name: Check the minified JS script size
runs: |
{ test -s test.min.js && \
test $(stat -c%s test.min.js) -lt $(stat -c%s test.js); } || \
exit 1
update:
enabled: true
github:
identifier: terser/terser
use-tag: true

0 comments on commit 5c08e52

Please sign in to comment.