Skip to content

Commit

Permalink
Merge pull request #35 from gmarty/grunt
Browse files Browse the repository at this point in the history
Use Grunt to build minified script
  • Loading branch information
vvo committed Mar 1, 2013
2 parents 7846773 + 5640b00 commit b639b5e
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1 +1,2 @@
node_modules
node_modules
*.report.txt
39 changes: 39 additions & 0 deletions Gruntfile.js
@@ -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']);

};
2 changes: 1 addition & 1 deletion lazyload.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -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": [
Expand Down

0 comments on commit b639b5e

Please sign in to comment.