Created
February 13, 2011 20:57
-
-
Save millermedeiros/825117 to your computer and use it in GitHub Desktop.
RequireJS optimizer Ant task
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<project name="sample-require-js" default="" basedir="."> | |
<!-- properties --> | |
<property name="r.js" value="_build/rjs/r.js" /> | |
<property name="closure.jar" value="_build/closure/compiler.jar" /> | |
<property name="rhino.jar" value="_build/rhino/js.jar" /> | |
<property name="js.build" value="_build/js.build.js" /> | |
<property name="css.build" value="_build/css.build.js" /> | |
<!-- custom tasks --> | |
<!-- targets --> | |
<target name="-optimize" description="Combine and minify files."> | |
<java classname="org.mozilla.javascript.tools.shell.Main"> | |
<classpath> | |
<pathelement location="${rhino.jar}" /> | |
<pathelement location="${closure.jar}" /> | |
</classpath> | |
<arg value="${r.js}"/> | |
<arg value="-o"/> | |
<arg value="${requirejs.optimizer.settings}"/> | |
</java> | |
<echo message="optimized ${requirejs.optimizer.settings}" /> | |
</target> | |
<target name="optimizeJS"> | |
<echo message="Combining and minifying JS files." /> | |
<antcall target="-optimize"> | |
<param name="requirejs.optimizer.settings" value="${js.build}" /> | |
</antcall> | |
</target> | |
<target name="optimizeCSS"> | |
<echo message="Combining and compressing CSS files." /> | |
<antcall target="-optimize"> | |
<param name="requirejs.optimizer.settings" value="${css.build}" /> | |
</antcall> | |
</target> | |
</project> |
This file contains hidden or 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
({ | |
baseUrl: "../style", | |
optimizeCss : "standard", | |
dir: "../../../deploy/style" | |
}) |
This file contains hidden or 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
({ | |
baseUrl: "../scripts", | |
dir: "../../../deploy/scripts", | |
modules: [ | |
{ | |
name: "main", | |
include : [ | |
"lib/my_awesome_shared_lib" | |
] | |
}, | |
{ | |
name : "sections/home/main", | |
exclude : [ | |
"lib/my_awesome_shared_lib" | |
] | |
}, | |
{ | |
name : "sections/gallery/main", | |
exclude : [ | |
"lib/my_awesome_shared_lib" | |
] | |
} | |
] | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
updated example to work with 0.23+ thanks for the heads up @jlanglade