Get basic grunt-ified CSS and JS working. Note that this currently uses the dist bundles for both prod and debug.
This commit is contained in:
parent
cbd0f30070
commit
7aab6a9fdd
13 changed files with 52 additions and 28831 deletions
|
@ -6,18 +6,32 @@ module.exports = function(grunt) {
|
|||
concat: {
|
||||
options: {
|
||||
process: function(src, filepath) {
|
||||
return '// Source: ' + filepath + '\n' +
|
||||
'(function() {\n' + src + '\n})();\n';
|
||||
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: '../dest/<%= pkg.name %>.js'
|
||||
dest: '../static/dist/<%= pkg.name %>.js'
|
||||
}
|
||||
},
|
||||
|
||||
cssmin: {
|
||||
'../dest/<%= pkg.name %>.css': ['../static/lib/**/*.css', '../static/css/*.css']
|
||||
'../static/dist/<%= pkg.name %>.css': ['../static/lib/**/*.css', '../static/css/*.css']
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Reference in a new issue