0

Im trying to create a custom build for an application, my project is in mvc with no root js file,now am trying to build all javascript files into one new js file with dojo version 1.9.3. Build is success but when am trying to load the application with the new build js file,"ïs not a function" error. my javascript files are not full amd converted. profile.js looks like

 var profile = {

    basePath: '../src/',
    releaseDir: "/assets/js_prod/",
    action: 'release',
    mini: true,
    optimize: 'Closure',
    layerOptimize: 'Closure',
    packages: [
        {
           name: "dojo",
            location: "assets/dojo_build/dojo"
        }, {
            name: "js",
            location: "assets/js"
         },{
            name: "dijit",
            location: "assets/dojo_build/dijit"
        },{
            name: "dojox",
            location: "assets/dojo_build/dojox"
        }  /*,{
            name: "css",
            location: "assets/css"
        }  */
    ],
    stripConsole: 'all',
    selectorEngine: 'lite',
    layers: {

          'dojo/dojo': {
            customBase: true,
            boot: true,
        },  
        'js/testbuild': {
        include: [
        'js/abcaction',
        'js/api',
        'js/abc',
        'js/Dropdown',
        'js/abc',
        'js/test',
        'js/datas',
        'js/history',
        'js/library'
        ]
        }
    },

    staticHasFeatures: {
        'dojo-trace-api':0,
        'dojo-log-api':0,
        'dojo-publish-privates':0,
        'dojo-sync-loader':0,
        'dojo-xhr-factory':0,
        'dojo-test-sniff':0 
    }
};

and including build file(testbuild.js) looks like

<script data-dojo-config="async: 1, dojoBlankHtmlUrl: '/blank.html',
        packages: [ {
            name: 'buildjs',
            location: '/assets/js_prod'
        } ]"
    src="/assets/js_prod/dojo/dojo.js"></script>

    require([
                "buildjs/testbuild"
            ], function(testbuild) {

                    testbuild.abcactionInit(false);

            });
angel
  • 5
  • 3
  • The build only works with AMD files. All non-AMD files need to be included in your source directory structure in addition to your build. – user2867288 Dec 04 '15 at 15:58
  • thanks for the reply.are there any tools to convert non-amd js to amd ? – angel Dec 06 '15 at 22:55
  • Yes, but I would recommend you do it manually. It requires some human thought and is easy to do. https://github.com/jrburke/r.js – user2867288 Dec 07 '15 at 15:05
  • Thanks will check r.js to convert non-amd to amd as i have many files to convert. – angel Dec 07 '15 at 23:33

0 Answers0