Permalink
Browse files

hello Grunt. Including closure-compiler task, too.

  • Loading branch information...
paulirish committed Jun 8, 2012
1 parent 78365ab commit 9dc8ad5557d14210c02c905b6e348aa7ff972c3f
Showing with 101 additions and 4 deletions.
  1. +1 −0 .gitignore
  2. +13 −0 build/build.sh
  3. BIN build/compiler.jar
  4. +46 −0 grunt.js
  5. +4 −2 index.html
  6. +24 −0 js/script.min.js
  7. +4 −1 package.json
  8. +8 −0 script.min.js.map
  9. +1 −1 template.html
View
@@ -1,2 +1,3 @@
node_modules
.sass-cache
+js/script.min.js.report.txt
View
@@ -0,0 +1,13 @@
+# this is mostly deprecated as grunt should tackle this now.
+# but grunt cant do the sourcemappingurl append bit yet.
+
+java -jar build/compiler.jar \
+ --js js/libs/augment.js \
+ --js js/libs/list.js \
+ --js js/libs/classList.js \
+ --js js/script.js \
+ --create_source_map ./script.min.js.map \
+ --source_map_format=V3 \
+ --js_output_file js/script.min.js
+
+echo "//@ sourceMappingURL=../script.min.js.map" >> js/script.min.js
View
Binary file not shown.
View
@@ -0,0 +1,46 @@
+// Resources
+// https://gist.github.com/2489540
+
+/*global config:true, task:true*/
+module.exports = function( grunt ) {
+
+ var task = grunt.task;
+ var file = grunt.file;
+ var utils = grunt.utils;
+ var log = grunt.log;
+ var verbose = grunt.verbose;
+ var fail = grunt.fail;
+ var option = grunt.option;
+ var config = grunt.config;
+ var template = grunt.template;
+
+ grunt.loadNpmTasks('grunt-closure-compiler');
+
+ grunt.initConfig({
+
+ qunit: {
+ files: "test/index.html"
+ },
+
+ 'closure-compiler': {
+ frontend: {
+ js: [
+ 'js/libs/augment.js',
+ 'js/libs/list.js',
+ 'js/libs/classList.js',
+ 'js/script.js'
+ ],
+ jsOutputFile: 'js/script.min.js',
+ options: {
+ 'create_source_map':'./script.min.js.map',
+ 'source_map_format':'V3'
+ }
+ }
+ }
+
+ });
+
+ // Default grunt.
+ grunt.registerTask( "default", "qunit" );
+
+};
View
@@ -231,9 +231,11 @@ <h4 class="kind css">css</h4>
</header>
<div class="more">
<div class="recco">
- <p><a href="http://paulirish.com/2012/box-sizing-border-box-ftw/"><code>box-sizing : border-box</code></a> may be a much more sensible default for you. You can apply it to all (<code>*</code>) elements if you like. Firefox is the only browser that requires a prefix for box-sizing. You can use it without a prefix for everything else. IE8 has this feature natively, and you can optionally use the <a href="https://github.com/Schepp/box-sizing-polyfill">box-sizing polyfill</a> to provide this feature in IE 6/7 (you could scope the adjustments using <a href="http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/">IE conditionals</a> or Modernizr's <a href="http://www.modernizr.com/download/#-cssclasses-addtest-css_boxsizing"><code>no-box-sizing</code></a>).</p>
+ <p>Supported in Chrome, IE8+, Opera, Safari 5.1+. The <a href="http://paulirish.com/2012/box-sizing-border-box-ftw/">recommended pattern</a> is <code>box-sizing : border-box;</code>, preceded by the fallbacks <code>-webkit-box-sizing: border-box;</code> for old IOS&lt;=4 and Android&lt;=2.3, and <code>-moz-box-sizing: border-box;</code> for firefox. You can apply it to all (<code>*</code>) elements if you like.</p>
-<p>There are still issues regarding max-height/min-height and box sizing in Gecko/Firefox, see <a href="https://developer.mozilla.org/En/CSS/Box-sizing#Notes">notes at MDN</a>.</p>
+<p>For IE6/7 you can optionally use the <a href="https://github.com/Schepp/box-sizing-polyfill">box-sizing polyfill</a> to provide this feature in IE 6/7 (you could scope the adjustments using <a href="http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/">IE conditionals</a> or Modernizr's <a href="http://www.modernizr.com/download/#-cssclasses-addtest-css_boxsizing"><code>no-box-sizing</code></a>).</p>
+
+<p>Besides the prefix, there are box sizing issues in Gecko/Firefox, see <a href="https://developer.mozilla.org/En/CSS/Box-sizing#Notes">notes at MDN</a>. Most notable, min-height/max-height does not work.</p>
</div>
<div class="polyfills"></div>
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -18,7 +18,10 @@
"handlebars": "*",
"node-markdown": "*",
"request": "*",
- "async": "*"
+ "async": "*",
+
+ "grunt": "*",
+ "grunt-closure-compiler" : "*"
},
"devDependencies": {}
}
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -91,7 +91,7 @@ <h2 id="noitems" class="visuallyhidden">No items met your search =(</h2>
<script src="js/script.js"></script>
are compiled (with source map) into... -->
- <script src="js/script-min.js"></script>
+ <script src="js/script.min.js"></script>
<script>
var _gaq=[['_setAccount','UA-17904194-3'],['_trackPageview'],['_trackPageLoadTime']];

0 comments on commit 9dc8ad5

Please sign in to comment.