Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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