From 83d05669f8d309189521df00da7baf964adc1888 Mon Sep 17 00:00:00 2001 From: Ricardo Tomasi Date: Sat, 18 May 2013 01:02:44 -0300 Subject: [PATCH] Enable options forwarding for uglify and csso minifiers --- adapters/minifiers.coffee | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/adapters/minifiers.coffee b/adapters/minifiers.coffee index 481ecc5..328c7df 100644 --- a/adapters/minifiers.coffee +++ b/adapters/minifiers.coffee @@ -4,9 +4,13 @@ module.exports = new Adapter js: (file, cb) -> uglify = require 'uglify-js' + + options = Adapter.getOptions this + options.fromString = true + file.read (code) -> if uglify.minify? # uglify > 2.0 - res = uglify.minify(code, { fromString: true }).code + res = uglify.minify(code, options).code else # old API { parser: jsp, uglify: pro } = uglify res = pro.gen_code pro.ast_squeeze pro.ast_mangle jsp.parse code @@ -14,6 +18,11 @@ module.exports = new Adapter css: (file, cb) -> csso = require 'csso' + + options = Adapter.getOptions this, { + restructure: false + } + file.read (code) -> - res = csso.justDoIt code + res = csso.justDoIt code, options.restructure cb res \ No newline at end of file