forked from abernix/minifier-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to Uglify Harmony 2.8.22 and add support Babili fallback.
This is the same behavior of the official `minifier-js` package, except with the Harmony branch.
- Loading branch information
Showing
4 changed files
with
39 additions
and
69 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,8 @@ | ||
abernix:minifier-js@1.3.19 | ||
allow-deny@1.0.5 | ||
babel-compiler@6.14.1 | ||
babel-runtime@1.0.1 | ||
base64@1.0.10 | ||
binary-heap@1.0.10 | ||
blaze@2.1.9 | ||
blaze-tools@1.0.10 | ||
boilerplate-generator@1.0.11 | ||
callback-hook@1.0.10 | ||
check@1.2.5 | ||
ddp@1.2.5 | ||
ddp-client@1.3.3 | ||
ddp-common@1.2.8 | ||
ddp-server@1.3.13 | ||
deps@1.0.12 | ||
diff-sequence@1.0.7 | ||
ecmascript@0.6.3 | ||
abernix:minifier-js@2.0.0 | ||
babel-compiler@6.18.1 | ||
ecmascript-runtime@0.3.15 | ||
ejson@1.0.13 | ||
geojson-utils@1.0.10 | ||
html-tools@1.0.11 | ||
htmljs@1.0.11 | ||
id-map@1.0.9 | ||
jquery@1.11.10 | ||
local-test:abernix:minifier-js@1.3.19 | ||
logging@1.1.17 | ||
meteor@1.6.1 | ||
minimongo@1.0.21 | ||
modules@0.7.9 | ||
modules-runtime@0.7.9 | ||
mongo@1.1.16 | ||
mongo-id@1.0.6 | ||
npm-mongo@2.2.24 | ||
observe-sequence@1.0.16 | ||
ordered-dict@1.0.9 | ||
modules@0.8.1 | ||
modules-runtime@0.7.10 | ||
promise@0.8.8 | ||
random@1.0.10 | ||
reactive-var@1.0.11 | ||
retry@1.0.9 | ||
routepolicy@1.0.12 | ||
spacebars@1.0.13 | ||
spacebars-compiler@1.0.13 | ||
tinytest@1.0.12 | ||
tracker@1.1.2 | ||
ui@1.0.12 | ||
underscore@1.0.10 | ||
webapp@1.3.14 | ||
webapp-hashing@1.0.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,25 @@ | ||
UglifyJS = Npm.require('uglify-js'); | ||
UglifyJSMinify = UglifyJS.minify; | ||
var uglify; | ||
|
||
meteorJsMinify = function (source) { | ||
var result = {}; | ||
uglify = uglify || Npm.require("uglify-js"); | ||
|
||
try { | ||
result.code = uglify.minify(source, { | ||
fromString: true, | ||
compress: { | ||
drop_debugger: false, | ||
unused: false, | ||
dead_code: false | ||
} | ||
}).code; | ||
|
||
} catch (e) { | ||
// Although Babel.minify can handle a wider variety of ECMAScript | ||
// 2015+ syntax, it is substantially slower than UglifyJS, so we use | ||
// it only as a fallback. | ||
result.code = Babel.minify(source).code; | ||
} | ||
|
||
return result; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,16 @@ | ||
Package.describe({ | ||
name: 'abernix:minifier-js', | ||
summary: "JavaScript minifier", | ||
version: "1.3.19" | ||
version: "2.0.0" | ||
}); | ||
|
||
Npm.depends({ | ||
"source-map": "0.5.6", | ||
"uglify-js": "git+https://github.com/mishoo/UglifyJS2#harmony-v2.8.15", | ||
}); | ||
|
||
Npm.strip({ | ||
"uglify-js": ["test/"] | ||
"uglify-js": "git+https://github.com/mishoo/UglifyJS2#harmony-v2.8.22", | ||
}); | ||
|
||
Package.onUse(function (api) { | ||
api.export(['UglifyJSMinify', 'UglifyJS']); | ||
api.use('babel-compiler@6.18.1'); | ||
api.export(['meteorJsMinify']); | ||
api.addFiles(['minifier.js'], 'server'); | ||
}); | ||
|
||
Package.onTest(function (api) { | ||
api.use('abernix:minifier-js', 'server'); | ||
api.use('tinytest'); | ||
|
||
api.addFiles([ | ||
'beautify-tests.js', | ||
], 'server'); | ||
}); |