-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Working build with AMD stripping and minification.
- Loading branch information
Showing
6 changed files
with
38 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* Modernizr 3.0.0pre (Custom Build) | MIT & BSD */ |
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,11 @@ | ||
<!doctype html> | ||
<html class="no-js" lang=en> | ||
<head> | ||
<title>Modular Modernizr Demo Page</title> | ||
</head> | ||
<body> | ||
Console, yo. | ||
|
||
<script src="dist/modernizr-build.min.js"></script> | ||
</body> | ||
</html> |
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
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,20 @@ | ||
var fs = require('fs'); | ||
|
||
var jsp = require("uglify-js").parser; | ||
var pro = require("uglify-js").uglify; | ||
|
||
var mod = fs.readFileSync(__dirname + '/dist/modernizr-build.js', 'utf8'); | ||
var license = fs.readFileSync(__dirname + '/LICENSE', 'utf8'); | ||
|
||
mod = mod.replace('define("modernizr-init",[], function(){});', ''); | ||
mod = license + "\n;(function(window, document, undefined){\n" + mod + "\n})(this, document);"; | ||
|
||
fs.writeFileSync(__dirname + '/dist/modernizr-build.js', mod, 'utf8'); | ||
|
||
var ast = jsp.parse(mod); // parse code and get the initial AST | ||
ast = pro.ast_lift_variables(ast); | ||
ast = pro.ast_mangle(ast, {except : ["Modernizr"]}); // get a new AST with mangled names | ||
ast = pro.ast_squeeze(ast); // get an AST with compression optimizations | ||
var final_code = pro.gen_code(ast); | ||
|
||
fs.writeFileSync(__dirname + '/dist/modernizr-build.min.js', license + ";" + final_code, 'utf8'); |