Skip to content

Instantly share code, notes, and snippets.

@rd13
Created October 25, 2018 12:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rd13/967f6354c0671218c61ea5332c2153bf to your computer and use it in GitHub Desktop.
Save rd13/967f6354c0671218c61ea5332c2153bf to your computer and use it in GitHub Desktop.
npm script to pass multiple files through uglifyjs
{
"scripts": {
"compress:js:components": "find dist/components/*.js -type f -exec basename {} .js \\; | xargs -I '{}' uglifyjs --compress --mangle --output dist/components/{}.min.js -- dist/components/{}.js",
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment