forked from DmitryBaranovskiy/raphael
-
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.
- Loading branch information
1 parent
300aa58
commit c472a26
Showing
7 changed files
with
436 additions
and
300 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env node | ||
var setup = { | ||
input: { | ||
core: "raphael.core.js", | ||
svg: "raphael.svg.js", | ||
vml: "raphael.vml.js", | ||
eve: "../mywork/eve/eve.js", | ||
copy: "copy.js" | ||
}, | ||
output: { | ||
"raphael-min.js": function () { | ||
return this.copy + "\n" + minify(this.eve + this.core + this.svg + this.vml); | ||
}, | ||
"raphael.js": function () { | ||
return this.copy + "\n" + this.eve + "\n\n" + this.core + "\n\n" + this.svg + "\n\n" + this.vml; | ||
}, | ||
"raphael.pro-min.js": function () { | ||
return this.copy + "\n" + minify(this.eve + this.core + this.svg); | ||
}, | ||
"raphael.pro.js": function () { | ||
return this.copy + "\n" + this.eve + "\n\n" + this.core + "\n\n" + this.svg ; | ||
}, | ||
} | ||
}, | ||
ujs = require("/Users/dmitry/Sites/UglifyJS/uglify-js.js"), | ||
jsp = ujs.parser, | ||
pro = ujs.uglify, | ||
fs = require("fs"), | ||
rxdr = /\/\*\\[\s\S]+?\\\*\//g; | ||
|
||
function minify(code) { | ||
return pro.gen_code(pro.ast_squeeze(pro.ast_mangle(jsp.parse(code)))); | ||
} | ||
|
||
var files = {}; | ||
for (var file in setup.input) { | ||
files[file] = String(fs.readFileSync(setup.input[file], "utf8")).replace(rxdr, ""); | ||
} | ||
for (file in setup.output) { | ||
(function (file) { | ||
fs.writeFile(file, setup.output[file].call(files), function () { | ||
console.log("Saved to \033[32m" + file + "\033[0m\n"); | ||
}); | ||
})(file); | ||
} |
Large diffs are not rendered by default.
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
Oops, something went wrong.