-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
try terser as JS minifier #268
base: dev
Are you sure you want to change the base?
Conversation
@melizeche thanks! I haven't tested it yet. But you could try using import shutil
print(shutil.which("yuglify"))
> '/Users/jorge/.nvm/versions/node/v8.9.1/bin/yuglify' I'll check your changes soon. I also wonder if this tool does the "translating" part (ES6+ => ES5). |
it's a minifier but we don't need translate to ES5, ES6 at least const is supported since android 2.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to change the terser binary directory because I'm using nvm
After all the assets in allstatic were generated without any problem
@juanhuttemann in theory it should work fine with env as |
fix to work on any platform import shutil
...
TERSER_BINARY = shutil.which("terser") |
@melizeche it works like a charm, though I used @juanhuttemann fix. I guess if you update the PR with his suggestion is good to go 👌 |
just a draft, @jorgeramirez @juanhuttemann can you guys tests if this approach is valid for #261 ?
reqs:
npm install -g terser
ref:
https://django-pipeline.readthedocs.io/en/latest/compressors.html#example