2018-02-26 17:09:00 -05:00
|
|
|
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
|
2024-03-21 00:07:40 -04:00
|
|
|
'dart-sass': {
|
|
|
|
dist: {
|
2018-02-26 17:09:00 -05:00
|
|
|
options: {
|
2024-03-21 00:07:40 -04:00
|
|
|
style: 'compressed'
|
2018-02-26 17:09:00 -05:00
|
|
|
},
|
|
|
|
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');
|
2024-03-21 00:07:40 -04:00
|
|
|
grunt.loadNpmTasks('grunt-dart-sass');
|
2018-02-26 17:09:00 -05:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
|
|
|
|
|
|
// do the tasks
|
2024-03-21 00:07:40 -04:00
|
|
|
grunt.registerTask('default', ['coffee', 'dart-sass', 'watch']);
|
2018-02-26 17:09:00 -05:00
|
|
|
|
|
|
|
};
|