docpad-plugin-uglify
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.4.0 | ||
// Generated by CoffeeScript 1.6.3 | ||
var __hasProp = {}.hasOwnProperty, | ||
@@ -6,9 +6,9 @@ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; | ||
module.exports = function(BasePlugin) { | ||
var UglifyPlugin; | ||
var UglifyPlugin, _ref; | ||
return UglifyPlugin = (function(_super) { | ||
__extends(UglifyPlugin, _super); | ||
function UglifyPlugin() { | ||
return UglifyPlugin.__super__.constructor.apply(this, arguments); | ||
_ref = UglifyPlugin.__super__.constructor.apply(this, arguments); | ||
return _ref; | ||
} | ||
@@ -18,30 +18,11 @@ | ||
UglifyPlugin.prototype.config = { | ||
strict_semicolons: true | ||
}; | ||
UglifyPlugin.prototype.renderUglify = function(opts, next) { | ||
var ast, content, file, parser, uglify, uglifyjs; | ||
content = opts.content, file = opts.file; | ||
uglifyjs = require("uglify-js"); | ||
parser = uglifyjs.parser, uglify = uglifyjs.uglify; | ||
try { | ||
ast = parser.parse(content, this.config.strict_semicolons); | ||
} catch (err) { | ||
return next(err); | ||
} | ||
ast = uglify.ast_mangle(ast); | ||
ast = uglify.ast_squeeze(ast); | ||
opts.content = uglify.gen_code(ast); | ||
return next(); | ||
}; | ||
UglifyPlugin.prototype.renderDocument = function(opts, next) { | ||
UglifyPlugin.prototype.renderDocument = function(opts) { | ||
var extension; | ||
extension = opts.extension; | ||
if (extension === 'js') { | ||
return this.renderUglify(opts, next); | ||
} else { | ||
return next(); | ||
opts.content = require('uglify-js').minify(opts.content, { | ||
fromString: true | ||
}).code; | ||
} | ||
return this; | ||
}; | ||
@@ -48,0 +29,0 @@ |
{ | ||
"name": "docpad-plugin-uglify", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Adds support for uglify-js's parser/compressor to DocPad", | ||
@@ -33,6 +33,7 @@ "homepage": "http://docpad.org/plugin/uglify", | ||
"dependencies": { | ||
"uglify-js": "~1.3.3" | ||
"uglify-js": "~2.3.6" | ||
}, | ||
"devDependencies": { | ||
"coffee-script": "~1.4.0" | ||
"coffee-script": "~1.6.2", | ||
"docpad": ">=6.37 <7" | ||
}, | ||
@@ -39,0 +40,0 @@ "main": "./out/uglify.plugin.js", |
@@ -1,5 +0,11 @@ | ||
# UglifyJS Plugin for DocPad | ||
Adds support for [UglifyJS](https://github.com/mishoo/UglifyJS) 's parser/compressor to [DocPad](https://github.com/bevry/docpad) | ||
# [UglifyJS](https://github.com/mishoo/UglifyJS) Plugin for [DocPad](http://docpad.org) | ||
[![Build Status](https://secure.travis-ci.org/docpad/docpad-plugin-uglify.png?branch=master)](http://travis-ci.org/docpad/docpad-plugin-uglify "Check this project's build status on TravisCI") | ||
[![NPM version](https://badge.fury.io/js/docpad-plugin-uglify.png)](https://npmjs.org/package/docpad-plugin-uglify "View this project on NPM") | ||
[![Flattr donate button](https://raw.github.com/balupton/flattr-buttons/master/badge-89x18.gif)](http://flattr.com/thing/344188/balupton-on-Flattr "Donate monthly to this project using Flattr") | ||
[![PayPayl donate button](https://www.paypalobjects.com/en_AU/i/btn/btn_donate_SM.gif)](https://www.paypal.com/au/cgi-bin/webscr?cmd=_flow&SESSION=IHj3DG3oy_N9A9ZDIUnPksOi59v0i-EWDTunfmDrmU38Tuohg_xQTx0xcjq&dispatch=5885d80a13c0db1f8e263663d3faee8d14f86393d55a810282b64afed84968ec "Donate once-off to this project using Paypal") | ||
Automatically minifies your JavaScript output with UglifyJS | ||
## Install | ||
@@ -13,3 +19,3 @@ | ||
## History | ||
You can discover the history inside the `History.md` file | ||
[You can discover the history inside the `History.md` file](https://github.com/bevry/docpad-plugin-uglify/blob/master/History.md#files) | ||
@@ -19,2 +25,2 @@ | ||
Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/) | ||
<br/>Copyright © 2012 [Takeharu.Oshida](http://georgeosddev.github.com) | ||
<br/>Copyright © 2012+ [Takeharu.Oshida](http://georgeosddev.github.com) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
3624
24
0
2
25
+ Addedamdefine@1.0.1(transitive)
+ Addedasync@0.2.10(transitive)
+ Addedoptimist@0.3.7(transitive)
+ Addedsource-map@0.1.43(transitive)
+ Addeduglify-js@2.3.6(transitive)
+ Addedwordwrap@0.0.3(transitive)
- Removeduglify-js@1.3.5(transitive)
Updateduglify-js@~2.3.6