Last active
August 29, 2015 14:11
-
-
Save rjmacarthy/628bc5452100c4287b37 to your computer and use it in GitHub Desktop.
Grunt SASS
This file contains 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
var path = require('path'); | |
module.exports = function(grunt) { | |
grunt.initConfig({ | |
sass: { | |
dist: { | |
options: { | |
includePaths: require('node-refills').includePaths | |
}, | |
files: { | |
'public/css/style.css': 'public/scss/style.scss' | |
} | |
} | |
}, | |
express: { | |
options: { | |
port: 3000, | |
hostname: '*' | |
}, | |
livereload: { | |
options: { | |
server: path.resolve('./app.js'), | |
livereload: true, | |
serverreload: true, | |
bases: [path.resolve('./public')] | |
} | |
} | |
}, | |
watch: { | |
css: { | |
files: ['**/*.scss'], | |
tasks: ['sass', 'concat', 'cssmin'] | |
}, | |
js: { | |
files: ['public/js/*.js'], | |
tasks: ['concat', 'uglify', 'jshint'] | |
} | |
}, | |
jshint: { | |
all: { | |
src: 'public/js/main.js' | |
} | |
}, | |
concat: { | |
js: { | |
src: 'public/js/*.js', | |
dest: 'public/dist/main.js' | |
}, | |
css: { | |
src: 'public/css/*.css', | |
dest: 'public/dist/main.css' | |
} | |
}, | |
uglify: { | |
dist: { | |
src: 'public/dist/main.js', | |
dest: 'public/dist/main.min.js' | |
} | |
}, | |
cssmin: { | |
css: { | |
src: 'public/dist/main.css', | |
dest: 'public/dist/main.min.css' | |
} | |
}, | |
concurrent: { | |
default: ['express', 'watch', 'jshint'], | |
options: { | |
logConcurrentOutput: true, | |
limit: 4 | |
} | |
} | |
}); | |
require('load-grunt-tasks')(grunt); | |
grunt.registerTask('default', ['sass', 'concat', 'uglify', 'cssmin', 'concurrent:default']) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment