From 7bba2c682337a99279deb67f0b484a1f83347e0f Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Mon, 26 Feb 2018 17:09:00 -0500 Subject: [PATCH] Added Gruntfile for compiling SASS and CoffeeScript files --- Gruntfile.js | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Gruntfile.js diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..67ac217 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,68 @@ +module.exports = function(grunt) { + + // time the grunt execution time + require('time-grunt')(grunt); + + // configure main project settings + grunt.initConfig({ + + // basic config + pkg: grunt.file.readJSON('package.json'), + + // CoffeeScript compiling + coffee: { + compile: { + options: { + sourceMap: false + }, + expand: true, + flatten: true, + cwd: 'src/coffee', + src: '*.coffee', + dest: 'build/js', + ext: '.js' + } + }, + + // SASS compiling + sass: { + compile: { + options: { + style: 'compact' + }, + files: [{ + expand: true, + cwd: 'src/sass', + src: ['*.sass'], + dest: 'build/css', + ext: '.css' + }] + } + }, + + // watch sass and CoffeeScript files for live reloading + watch: { + scripts: { + files: [ + 'src/sass/*.sass', + 'src/sass/*.scss', + 'src/coffee/*.coffee' + ], + tasks: ['sass', 'coffee'], + options: { + spawn: false + } + } + } + + }); + + // load plugins + grunt.loadNpmTasks('grunt-contrib-coffee'); + grunt.loadNpmTasks('grunt-contrib-sass'); + grunt.loadNpmTasks('grunt-contrib-watch'); + + // do the tasks + grunt.registerTask('default', ['coffee', 'sass', 'watch']); + +};