perfect-scrollbar/Gruntfile.js

87 lines
2.2 KiB
JavaScript
Raw Normal View History

2013-06-15 22:45:57 +08:00
'use strict';
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
2013-06-15 22:45:57 +08:00
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('perfect-scrollbar.jquery.json'),
2014-10-14 08:27:15 +08:00
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %>\n' +
2013-06-15 22:45:57 +08:00
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
clean: {
files: ['min']
},
2013-06-15 22:45:57 +08:00
// Task configuration.
uglify: {
options: {
banner: '<%= banner %>'
},
min: {
files: {
'min/perfect-scrollbar.min.js': ['src/perfect-scrollbar.js']
2013-06-15 22:45:57 +08:00
}
}
2013-06-15 22:45:57 +08:00
},
jshint: {
gruntfile: {
options: {
jshintrc: '.jshintrc'
},
src: 'Gruntfile.js'
},
src: {
options: {
jshintrc: '.jshintrc'
},
src: 'src/perfect-scrollbar.js'
}
},
cssmin: {
options: {
banner: '<%= banner %>'
},
minify: {
expand: true,
cwd: 'src/',
src: ['perfect-scrollbar.css'],
dest: 'min/',
2014-05-17 12:55:21 +08:00
ext: '.min.css'
2013-06-15 22:45:57 +08:00
}
2014-10-14 08:27:15 +08:00
},
bump: {
options: {
files: ['package.json', 'bower.json', 'perfect-scrollbar.jquery.json'],
updateConfigs: ['pkg'],
commit: false,
createTag: false,
push: false
}
},
sass: {
dist: {
files: {
'src/perfect-scrollbar.css': 'src/perfect-scrollbar.scss'
}
}
2013-06-15 22:45:57 +08:00
}
});
grunt.registerTask('default', 'List commands', function () {
grunt.log.writeln("");
grunt.log.writeln("Run 'grunt lint' to lint the source files");
grunt.log.writeln("Run 'grunt build' to minify the source files");
});
grunt.registerTask('lint', ['jshint']);
grunt.registerTask('build', ['clean', 'uglify', 'sass', 'cssmin']);
2013-07-08 22:01:49 +08:00
grunt.registerTask('travis', ['lint']);
2014-10-14 08:27:15 +08:00
grunt.registerTask('release', 'Release a new version', function (arg) {
var bumpType = arg ? ':' + arg : '';
grunt.task.run(['lint', 'bump' + bumpType, 'build']);
});
2013-06-15 22:45:57 +08:00
};