blt/Gruntfile.js
Gregory Ballantine 8e20e5e354 3-add-gruntjs (#9)
Adding Grunt.js to compile SASS and CoffeeScript assets

Co-authored-by: Gregory Ballantine <gregory.w.ballantine@nasa.gov>
Co-authored-by: Gregory Ballantine <gballantine555@gmail.com>
Reviewed-on: #9
2024-05-31 09:00:18 -04:00

66 lines
1.2 KiB
JavaScript

module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
options: {
style: 'compressed'
},
files: [{
expand: true,
cwd: 'assets/styles',
src: ['**/*.sass'],
dest: 'public/css',
ext: '.css'
}]
}
},
coffee: {
options: {
sourceMap: true,
style: 'compressed'
},
files: {
expand: true,
flatten: true,
cwd: 'assets/scripts',
src: ['*.coffee'],
dest: 'public/js',
ext: '.js'
}
},
watch: {
css: {
files: ['assets/styles/**/*.sass'],
tasks: ['sass'],
options: {
atBegin: true,
spawn: false
}
},
js: {
files: ['assets/scripts/**/*.js'],
tasks: ['coffee'],
options: {
atBegin: true,
spawn: false
}
}
}
});
// Load plugins.
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-coffee');
// CLI tasks.
grunt.registerTask('default', ['sass', 'coffee']);
};