Skip to content

Instantly share code, notes, and snippets.

@brendalong
Created February 7, 2017 15:32
Show Gist options
  • Save brendalong/c22b31d4942e97733d075e1380342307 to your computer and use it in GitHub Desktop.
Save brendalong/c22b31d4942e97733d075e1380342307 to your computer and use it in GitHub Desktop.
grunt with browserify
module.exports = function(grunt){
grunt.initConfig({
browserify: {
'../dist/app.js': ['../javascripts/main.js']
},
jshint: {
options: {
predef: ["document", "console"],
esnext: true,
globalstrict: true,
globals: {"$": true},
browserify: true
},
files: ['../javascripts/**/*.js']
},
sass: {
dist:{
files: {
'../css/main.css': '../sass/styles.scss'
}
}
},
watch: {
javascripts: {
files: ['../javascripts/**/*.js'],
tasks: ['jshint', 'browserify']
},
sass: {
files: ['../sass/**/*.scss'],
tasks: ['sass']
},
browserify: {
files: ['../javascripts/*.js'],
tasks: ["browserify"]
}
}
});
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.registerTask('default', ['jshint', 'sass', 'browserify', 'watch']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment