docpad-plugin-uglify
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -17,9 +17,15 @@ // Generated by CoffeeScript 1.6.3 | ||
UglifyPlugin.prototype.config = { | ||
all: true | ||
}; | ||
UglifyPlugin.prototype.renderDocument = function(opts) { | ||
var extension; | ||
extension = opts.extension; | ||
var extension, file; | ||
file = opts.file, extension = opts.extension; | ||
if (extension === 'js') { | ||
opts.content = require('uglify-js').minify(opts.content, { | ||
fromString: true | ||
}).code; | ||
if ((this.getConfig().all === true && file.get('minify') !== false) || (file.get('minify') === true)) { | ||
opts.content = require('uglify-js').minify(opts.content, { | ||
fromString: true | ||
}).code; | ||
} | ||
} | ||
@@ -26,0 +32,0 @@ return this; |
{ | ||
"name": "docpad-plugin-uglify", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Adds support for uglify-js's parser/compressor to DocPad", | ||
@@ -5,0 +5,0 @@ "homepage": "http://docpad.org/plugin/uglify", |
@@ -18,2 +18,6 @@ # [UglifyJS](https://github.com/mishoo/UglifyJS) Plugin for [DocPad](http://docpad.org) | ||
## Configuration | ||
By default we will minify all javascript files that don't have `minify: false` in their meta data. You can turn this off by setting `plugins: uglify: all: false` in your docpad configuration file then explicitly setting `minify: true` in your meta data. | ||
## History | ||
@@ -20,0 +24,0 @@ [You can discover the history inside the `History.md` file](https://github.com/bevry/docpad-plugin-uglify/blob/master/History.md#files) |
4111
30
28