Skip to content

Instantly share code, notes, and snippets.

@z-ohnami
Created September 11, 2014 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save z-ohnami/44240b169e60ce0ac6bd to your computer and use it in GitHub Desktop.
Save z-ohnami/44240b169e60ce0ac6bd to your computer and use it in GitHub Desktop.
Gruntfile.js sample
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
build: {
options: {
style: 'expanded'
},
src: 'scss/main.scss',
dest: 'css/main.css'
// files: {
// 'css/main.css' : 'scss/main.scss'
// // 'css/main.css' : ['scss/main.scss','scss/sub.scss']
// // 'css/main.css' : 'scss/**/*.scss'
// }
// files: [{
// expand: true,
// cwd: 'styles',
// src:['scss/*.scss'],
// dest:'css',
// ext:'.css'
// }]
}
},
csslint: {
check: {
src: '<%= sass.build.dest %>'
// files: '<%= sass.build.files %>'
}
},
cssmin: {
minify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */'
},
files: {
'css/main.min.css' : '<%= sass.build.dest %>'
}
}
},
watch: {
options: {
livereload: true
},
files: 'scss/*.scss',
tasks: ['sass','csslint','cssmin']
},
connect: {
server: {
options: {
port: 8080,
hostname: '192.168.24.24'
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-csslint');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('default',
['sass',
'csslint',
'cssmin',
'connect',
'watch']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment