Skip to content

Instantly share code, notes, and snippets.

@slashdotdash
Created February 19, 2014 22:15
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slashdotdash/9102812 to your computer and use it in GitHub Desktop.
Save slashdotdash/9102812 to your computer and use it in GitHub Desktop.
Grunt config to with task to compile React .jsx files to .js
/*global module:false*/
module.exports = function(grunt) {
grunt.initConfig({
react: {
jsx: {
files: [
{
expand: true,
cwd: 'public/js',
src: [ '**/*.jsx' ],
dest: 'public/js',
ext: '.js'
}
]
}
},
watch: {
react: {
files: 'public/js/**/*.jsx',
tasks: ['react']
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-react');
grunt.registerTask('default', ['react']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment