ocdownloader icon indicating copy to clipboard operation
ocdownloader copied to clipboard

How to edit minified js files?

Open Loki3000 opened this issue 7 years ago • 3 comments

As I see minifyed versions of JS must be removed from dev versions. It's almost impossible to edit it and complete impossible to check changes. Or it's must be provided recommended tool for compression (still bad idea). I think that files must be compressed immediately before publication.

Loki3000 avatar Sep 18 '17 12:09 Loki3000

Indeed, they should be generated before packaging a release using a build system. For now I use this to regenerate them after modifying the non-minified Javascript files: https://github.com/mishoo/UglifyJS2

e-alfred avatar Sep 19 '17 09:09 e-alfred

If I pack it myself, you can not test it for security - just make sure it's working. So I still think that in dev source must be no packed scripts.

Loki3000 avatar Sep 19 '17 10:09 Loki3000

@e-alfred what do you think of adding the minifiers for CSS and JS to a package.json? I would then specify some scripts there that handle the minification. As a bonus I could add a Makefile doing everyhing like installing dependencies.

For the tooling I suggest these:

  • JS: https://github.com/mishoo/UglifyJS2 (because you're already using it)
  • CSS: https://github.com/cssnano/cssnano

weeman1337 avatar Aug 15 '21 14:08 weeman1337