Skip to content

Instantly share code, notes, and snippets.

@kjunggithub
Created December 11, 2013 20:44
Show Gist options
  • Save kjunggithub/7918119 to your computer and use it in GitHub Desktop.
Save kjunggithub/7918119 to your computer and use it in GitHub Desktop.
Gruntfile.js
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
// jshint
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js',
'assets/js/*.js',
'!assets/js/scripts.min.js'
]
},
// sass
sass: {
dist: {
options: {
style: 'nested'
},
src: ['assets/sass/styles.scss'],
dest: 'assets/css/styles.min.css'
}
},
// concat
concat: {
options: {
separator: ';',
},
// combine all css files into one
basic: {
src: ['assets/css/bootstrap.min.css','assets/css/bootstrap-theme.min.css','assets/css/styles.min.css'],
dest: 'assets/release/main.css',
},
// combine all js files into one
extras: {
src: ['assets/js/bootstrap.min.js','assets/js/init.js'],
dest: 'assets/release/app.js',
},
},
// clean (delete files)
clean: {
release: [
'assets/css',
'assets/js',
'assets/sass',
]
},
});
// Load tasks
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-clean');
// Register tasks
grunt.registerTask('build', [
'sass',
'concat',
]);
grunt.registerTask('release', [
'sass',
'concat',
'clean',
]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment