Vincent Bernat wrote:
> (...)
> It has already been said numerous time in the past, for some _javascript_
> code, we don't really have the tools in Debian to easily go from the
> source to the minified version. It's possible, but without the
> appropriate tools, it's painful.
I've been using yui-compressor to get the minified _javascript_.
I never add any issue this it.
Now if you are talking about generating one big _javascript_ file
containing different fragments in the correct order, that's another
story. But that last issue is not really related to minified js. You can
compress the _javascript_ either before or after yui.
### _javascript_ minifier
# Use UglifyJS (what upstream uses) where available,
# yui-compressor (what upstream used in the past) where there is no UglifyJS
MINIFIER=$(shell which uglifyjs)
ifneq ($(MINIFIER),)
IS_UGLIFY2=$(shell grep -E '"version": "2\.[0-9]+\.[0-9]+"' /usr/lib/nodejs/uglify-js/package.json)
ifeq ($(IS_UGLIFY2),)
# Legacy: uglifyjs < 2.x
MINIFIER_FLAGS=-c --no-seqs -nc
else
# uglifyjs >= 2.x
MINIFIER_FLAGS=-c sequences=false
endif
else
MINIFIER=/usr/bin/yui-compressor
MINIFIER_FLAGS=--nomunge
endif