Created
June 14, 2014 18:11
-
-
Save quinn/98f86235d2592e85122b to your computer and use it in GitHub Desktop.
Gruntfile for react and less
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) { | |
var conf = { | |
browserify: { | |
options: { | |
transform: [ require('grunt-react').browserify ] | |
}, | |
app: { | |
src: 'app/scripts/main.js', dest: 'dist/bundle.js' | |
} | |
}, | |
less: { | |
default: { files: { 'css/main.css': 'dev/less/main.less' } } | |
}, | |
watch: { | |
less: { files: './app/**/*.less', tasks: ['less'] }, | |
react: { files: './app/**/*.js', tasks: ['browserify'] } | |
}, | |
concurrent: { | |
server: { | |
options: { logConcurrentOutput: true }, | |
tasks: ['watch', 'connect'] | |
} | |
}, | |
connect: { | |
server: { | |
options: { | |
port: 8080, | |
keepalive: true | |
} | |
} | |
} | |
}; | |
grunt.loadNpmTasks('grunt-browserify') | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-contrib-less'); | |
grunt.loadNpmTasks('grunt-concurrent'); | |
grunt.loadNpmTasks('grunt-contrib-connect'); | |
grunt.initConfig(conf); | |
grunt.registerTask('default', ['concurrent']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment