ericclemmons/grunt-react

How to use grunt-react with grunt-browserify?

djanosik opened this issue · 3 comments

Hi,

I would like to use grunt-react together with grunt-browserify. I've tried to follow your instructions, but the require('grunt-react').browserify always returns null. My Gruntfile.js looks like this.

module.exports = function (grunt) {
    grunt.initConfig({
        browserify: {
            app: {
                files: {
                    "wwwroot/js/app.js": ["Scripts/App.js"]
                },
                options: {
                    transform: [require('grunt-react').browserify]
                }
            }
        },
        browserifyBower: {
            lib: {
                options: {
                    file: "wwwroot/lib.js",
                    checkVersions: false
                }
            }
        },
        bower: {
            install: {
                options: {
                    layout: "byComponent",
                    targetDir: "wwwroot/lib",
                    cleanTargetDir: false
                }
            }
        }
    });

    grunt.loadNpmTasks("grunt-browserify");
    grunt.loadNpmTasks("grunt-browserify-bower");
    grunt.loadNpmTasks("grunt-bower-task");

    grunt.registerTask("default", [
        "bower:install",
        "browserify"
    ]);
};

Did I miss something?

Thank you!

👍

@djanosik It's probably related to #46

@djanosik This was a bug due to v0.12.1. Luckily, v0.12.1 is out with this fix, thanks to @apendua!

Comment again if this doesn't solve your problem, please!