Dependency traces failed/skipped by grunt-contrib-requirejs build

286 Views Asked by At

On build of this requirejs config using grunt-contrib-requirejs,

require.config({
            baseUrl : "js",
            shim    : {
                'ember' : {
                    deps :  ['handlebars', 'jquery'],
                    exports : 'Ember'
                },
                'bootstrap' : ['jquery'] ,
                'ember-data' : ['ember'],
                'handlebars' : {
                    exports : 'Handlebars'
                }
            },
            paths : {
                                /* APPLICATION  */
                'App' : 'app/ember-mock/app',
                'router' : 'app/ember-mock/router',
                'helper' : 'app/ember-mock/helper',
                'module' : 'app/ember-mock/module',
                'store' : 'app/ember-mock/store',
                                /* LIBRARIES */
                    *****
                    *****    //other  deps goes here
                    *****  


            },
            ****  //other options goes here
        });

        require([
               'App',
        'store',
        'router',****  //other requires goes here
         ], function(){
    });

my gruntfile.js file ,

module.exports = function(grunt) {
    'use strict';

    grunt.initConfig({
        pkg : grunt.file.readJSON('package.json'),
        requirejs : {
                        compile : {
                            options : {
                                baseUrl : 'js',
                                name : 'app/ember-mock/configuration/config',
                                mainConfigFile : 'js/app/ember-mock/configuration/config.js',
                                out : 'build/js/build.js',
                                optimize : 'uglify2',
                                inlintText : true,
                                findNestedDependencies : true
                            }
                        }
                    }

    });


    grunt.loadNpmTasks('grunt-contrib-requirejs');
    grunt.registerTask('default', [ 'requirejs' ]);

};

And my router.js file

define([ "App" ], function(EmberMockApp) {
    EmberMockApp.Router.map(function() {
        this.resource("app", {
            path : "/"
        });
        this.resource('home');
        this.resource('about');
        this.resource('blog');
        this.resource('connect');

    });
});

the router.js file is not traced as dependency by grunt-contrib-requirejs and skipped. Because of this no custom routers are registerd in ember app so emberjs is looking for default routes, so how to let grunt-contrib-require trace for router.js.

0

There are 0 best solutions below