Permalink
Browse files

Merge pull request #35 from gmarty/grunt

Use Grunt to build minified script
  • Loading branch information...
2 parents 7846773 + 5640b00 commit b639b5e069b635c3ecd74614a7b131bea6e5b44f @vvo committed Mar 1, 2013
Showing with 45 additions and 3 deletions.
  1. +2 −1 .gitignore
  2. +39 −0 Gruntfile.js
  3. +1 −1 lazyload.min.js
  4. +3 −1 package.json
View
@@ -1 +1,2 @@
-node_modules
+node_modules
+*.report.txt
View
@@ -0,0 +1,39 @@
+module.exports = function(grunt) {
+
+ grunt.loadNpmTasks('grunt-closure-compiler');
+ grunt.loadNpmTasks('grunt-contrib-concat');
+
+ // Project configuration.
+ grunt.initConfig({
+ pkg: grunt.file.readJSON('package.json'),
+
+ 'closure-compiler': {
+ min: {
+ js: 'lazyload.js',
+ jsOutputFile: 'lazyload.min.js',
+ options: {
+ compilation_level: 'ADVANCED_OPTIMIZATIONS',
+ //language_in: 'ECMASCRIPT5_STRICT',
+ summary_detail_level: 3,
+ warning_level: 'VERBOSE',
+ debug: false,
+ output_wrapper: '"(function(){%output%})();"'
+ }
+ }
+ },
+
+ concat: {
+ options: {
+ banner: '/*! <%= pkg.name %> v<%= pkg.version %> | github.com/vvo/lazyload#licence */\n'
+ },
+ dist: {
+ src: ['lazyload.min.js'],
+ dest: 'lazyload.min.js'
+ }
+ }
+ });
+
+ // Default task.
+ grunt.registerTask('default', ['closure-compiler', 'concat']);
+
+};
View

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

Oops, something went wrong.
View
@@ -8,7 +8,9 @@
},
"dependencies": {
"wd": "0.0.x",
- "async": "0.1.x"
+ "async": "0.1.x",
+ "grunt-closure-compiler": "0.0.x",
+ "grunt-contrib-concat": "0.1.x"
},
"private": true,
"keywords": [

0 comments on commit b639b5e

Please sign in to comment.