Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Commit

Permalink
add grunt for uglify and less
Browse files Browse the repository at this point in the history
  • Loading branch information
Gordon Koo committed Jul 14, 2013
1 parent d904b51 commit b9ac2f8
Show file tree
Hide file tree
Showing 9 changed files with 654 additions and 54 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
57 changes: 57 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
module.exports = function(grunt) {
var bannerComment = ['/**!',
'*',
'* Copyright 2013 LinkedIn Corp. All rights reserved.',
'*',
'* Licensed under the Apache License, Version 2.0 (the "License");',
'* you may not use this file except in compliance with the License.',
'* You may obtain a copy of the License at',
'*',
'* http://www.apache.org/licenses/LICENSE-2.0',
'*',
'* Unless required by applicable law or agreed to in writing, software',
'* distributed under the License is distributed on an "AS IS" BASIS,',
'* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.',
'* See the License for the specific language governing permissions and',
'* limitations under the License.',
'*/\n'].join('\n');

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: bannerComment
},
build: {
src: 'js/hopscotch-<%= pkg.version %>.js',
dest: 'js/hopscotch-<%= pkg.version %>.min.js'
}
},
less: {
development: {
options: {
paths: ["less"]
},
files: {
"css/hopscotch-<%= pkg.version %>.css": "less/hopscotch.less"
}
},
production: {
options: {
paths: ["less"],
yuicompress: true,
banner: bannerComment
},
files: {
"css/hopscotch-<%= pkg.version %>.min.css": "less/hopscotch.less"
}
}
}
});

// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-less');
// Default task(s).
grunt.registerTask('default', ['uglify', 'less']);
}
Loading

0 comments on commit b9ac2f8

Please # to comment.