43 lines
No EOL
1.2 KiB
JavaScript
43 lines
No EOL
1.2 KiB
JavaScript
module.exports = function(grunt) {
|
|
|
|
// Project configuration.
|
|
grunt.initConfig({
|
|
pkg: grunt.file.readJSON('package.json'),
|
|
concat: {
|
|
options: {
|
|
process: function(src, filepath) {
|
|
var unwraps = ['/js/'];
|
|
|
|
var shouldWrap = true;
|
|
for (var i = 0; i < unwraps.length; ++i) {
|
|
if (filepath.indexOf(unwraps[i]) >= 0) {
|
|
shouldWrap = false;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (shouldWrap) {
|
|
return '// Source: ' + filepath + '\n' +
|
|
'(function() {\n' + src + '\n})();\n';
|
|
} else {
|
|
return '// Source: ' + filepath + '\n' + src + '\n\n';
|
|
}
|
|
},
|
|
},
|
|
build: {
|
|
src: ['../static/lib/**/*.js', '../static/js/*.js', '!../static/lib/jquery.overscroll.min.js'],
|
|
dest: '../static/dist/<%= pkg.name %>.js'
|
|
}
|
|
},
|
|
|
|
cssmin: {
|
|
'../static/dist/<%= pkg.name %>.css': ['../static/lib/**/*.css', '../static/css/*.css']
|
|
}
|
|
});
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-concat');
|
|
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
|
|
|
// Default task(s).
|
|
grunt.registerTask('default', ['concat', 'cssmin']);
|
|
}; |