Last active
October 7, 2015 17:47
-
-
Save ptrikutam/f0b91bfa505740aadf4b to your computer and use it in GitHub Desktop.
Sample Gruntfile for the Sinatra Bootstrap
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
module.exports = function(grunt) { | |
// 1. All configuration goes here | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
concat: { | |
dist: { | |
src: [ | |
'app/assets/javascripts/libs/*.js', // All JS in the libs folder | |
'app/assets/javascripts/*.js' // This specific file | |
], | |
dest: 'public/javascripts/app.js', | |
} | |
}, | |
uglify: { | |
build: { | |
src: 'public/javascripts/app.js', | |
dest: 'public/javascripts/app.min.js' | |
} | |
}, | |
watch: { | |
scripts: { | |
files: ['app/assets/javascripts/*.js'], | |
tasks: ['concat', 'uglify'], | |
options: { | |
spawn: false, | |
}, | |
}, | |
css: { | |
files: ['app/assets/stylesheets/*.scss'], | |
tasks: ['sass'], | |
options: { | |
spawn: false, | |
} | |
} | |
}, | |
sass: { | |
dist: { | |
options: { | |
loadPath: require('node-bourbon').includePaths, | |
style: 'compressed' | |
}, | |
files: { | |
'public/stylesheets/application.css': 'app/assets/stylesheets/application.scss' | |
} | |
} | |
} | |
}); | |
// 3. Where we tell Grunt we plan to use this plug-in. | |
grunt.loadNpmTasks('grunt-contrib-concat'); // Concatenate JS | |
grunt.loadNpmTasks('grunt-contrib-uglify'); // Uglify that JS | |
grunt.loadNpmTasks('grunt-contrib-watch'); // Watch those files and update accordingly | |
grunt.loadNpmTasks('grunt-contrib-sass'); // Preprocess that CSS | |
// 4. Where we tell Grunt what to do when we type "grunt" into the terminal. | |
grunt.registerTask('default', ['concat', 'uglify', 'sass']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey mate, you've got a glitch in that code, here: