Skip to content

Instantly share code, notes, and snippets.

@jpellizzari
Last active August 28, 2015 23:24
Show Gist options
  • Save jpellizzari/5ac42f59654ebe060abe to your computer and use it in GitHub Desktop.
Save jpellizzari/5ac42f59654ebe060abe to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
browserify: {
app: {
options: {
debug: false,
transform: ['reactify']
},
src: 'app/js/index.js',
dest: 'dist/js/app.js'
},
test: {
src: [
'test/client/**/*.js'
],
dest: 'dist/js/test.js',
options: {
watch: false,
transform: ['reactify']
}
},
},
sass: {
options: {
sourceMap: true
},
dist: {
files: {
'dist/css/main.css': 'app/scss/main.scss'
}
}
},
jshint: {
// define the files to lint
files: ['app/**/*.js', 'lib/*.js', 'middleware/*.js', 'routes/*.js'],
// configure JSHint (documented at http://www.jshint.com/docs/)
options: {
// more options here if you want to override JSHint defaults
globals: {
jQuery: true,
console: true,
module: true
}
}
},
copy: {
main: {
files: [
{expand: true, cwd: 'app/html', src: ['*.html'], dest: 'dist/'},
],
},
tests: {
files: [
{expand: true, cwd: 'node_modules/', src: ['mocha/mocha.js','mocha/mocha.css', 'should/should.js'], dest: 'dist/vendor/'}
]
}
},
watch: {
scripts: {
files: ['app/**', 'test/client/**'],
tasks: ['browserify','sass', 'copy'],
options: {
spawn: false,
},
},
}
});
// Load the plugin that provides the task.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-concat-css');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-sass');
// Default task(s).
grunt.registerTask('default', ['browserify','copy','sass']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment