javascriptgruntjsrequirejsbroccolijsgrunt-contrib-requirejs

Broccoli and RequireJS


Hi I'm trying to improve the build time of a requirejs app using broccoli. I'm using Grunt as my task runner. This is the plugin I'm using:

https://github.com/dfournier/broccoli-requirejs

This is the code I have. Running the 'test' task does nothing?

grunt.registerTask( 'test', function( ) {
    var rjs = require( 'broccoli-requirejs' );

    var t = new rjs( 'private/application/controllers', {
        verbose: true,
        requirejs: {
            baseUrl: 'private/application/controllers/',
            dir: 'public/files/cache/',
            mainConfigFile: 'private/application/controllers/system/js/require.config.js',
            optimize: 'uglify2',
            skipDirOptimize: true,
            generateSourceMaps: true,
            findNestedDependencies: true,
            preserveLicenseComments: false,
            fileExclusionRegExp: /^(\.|views)|(\.php)$/,
            paths: {
                'requirejs': 'system/js/require.min'
            },
            modules: modules
        }
    });
});

This is how the project is structured:

private/application/controllers/one/js/index.js
private/application/controllers/two/js/index.js
...

The requirejs options work with grunt-contrib-requirejs but not with the broccoli plugin. Any ideas on what I'm doing wrong?

Thanks!


Solution

  • Spoke with the creator this package isn't compatible with Grunt.