Created
August 16, 2013 01:58
-
-
Save 6174/6246601 to your computer and use it in GitHub Desktop.
a sample grunt file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
/** | |
*--livescripts | |
*/ | |
livescript: { | |
src: { | |
files: { | |
// 'path/to/result.js': 'path/to/source.ls', // 1:1 compile | |
// 'path/to/another.js': ['path/to/sources/*.ls', 'path/to/more/*.ls'] // compile and concat into single file | |
} | |
} | |
}, | |
/** | |
*---uglify javascripts | |
*/ | |
uglify: { | |
options: { | |
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */ ' | |
}, | |
build: { | |
files: [{ | |
expand: true, | |
cwd: 'src/<%= pkg.version %>/public/', | |
src: ['**/*.js'], | |
dest: 'build/<%= pkg.version %>/', | |
ext: '.js', | |
}] | |
} | |
}, | |
/** | |
*--compile less css files | |
*/ | |
less: { | |
options: { | |
// yuicompress: true | |
}, | |
components: { | |
files: [{ | |
expand: true, | |
cwd: 'src/<%= pkg.version %>/public/stylesheets/', | |
src: '**/*.less', | |
dest: 'build/<%= pkg.version %>/public/stylesheets/', | |
ext: '.css' | |
}] | |
} | |
}, | |
/** | |
*--copy | |
*/ | |
copy: { | |
main: { | |
files: [{ | |
expand: true, | |
flatten: true, | |
cwd: 'src/<%= pkg.version %>/public/images/', | |
src: '**', | |
dest: 'build/<%= pkg.version %>/public/images/', | |
filter: 'isFile' | |
}, { | |
expand: true, | |
flatten: true, | |
cwd: 'src/<%= pkg.version %>/routes/', | |
src: '*', | |
dest: 'build/<%= pkg.version %>/routes/', | |
filter: 'isFile' | |
}, { | |
expand: true, | |
flatten: true, | |
cwd: 'src/<%= pkg.version %>/views/', | |
src: '*', | |
dest: 'build/<%= pkg.version %>/views/', | |
filter: 'isFile' | |
}, { | |
expand: true, | |
flatten: true, | |
cwd: 'src/<%= pkg.version %>/', | |
src: '*', | |
dest: 'build/<%= pkg.version %>/', | |
filter: 'isFile' | |
}] | |
} | |
} | |
}); | |
//--load uglify | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
//--load assemble-less | |
grunt.loadNpmTasks('assemble-less'); | |
//--load grunt-livescript | |
grunt.loadNpmTasks('grunt-livescript'); | |
//--load copy | |
grunt.loadNpmTasks('grunt-contrib-copy'); | |
// Default task(s). | |
grunt.registerTask('default', ['uglify', 'less', 'copy']); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "blackbord", | |
"version": "1.0.0", | |
"devDependencies": { | |
"grunt": "~0.4.1", | |
"grunt-kmc": "~0.1.1", | |
"grunt-contrib-uglify": "~0.2.0", | |
"grunt-contrib-cssmin": "~0.6.0", | |
"assemble-less": "~0.5.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment