需要有关创建dojo构建配置文件的帮助

时间:2014-07-04 11:26:10

标签: javascript build dojo

我的要求是在单独的战争中构建dojo并在应用程序war文件中使用它。为此,我需要在我的应用程序中创建包含所有必需的dojo组件的构建配置文件。有人可以用一个例子帮助我如何实现这个目标。我创建了一个无效的配置文件,下面是我创建的配置文件。

var profile = (function(){
    return {
        basePath: "/dojo-war/src/main/webapp/resources",
        releaseName: "dojo191",
        action: "release",
        layerOptimize: "closure",
        optimize: "closure",
        cssOptimize: "comments",
        mini: true,
        stripConsole: "warn",
        selectorEngine: "lite",

        defaultConfig: {
            hasCache:{
                "dojo-built": 1,
                "dojo-loader": 1,
                "dom": 1,
                "host-browser": 1,
                "config-selectorEngine": "lite"
            },
            async: 1
        },

        staticHasFeatures: {
            "config-deferredInstrumentation": 0,
            "config-dojo-loader-catches": 0,
            "config-tlmSiblingOfDojo": 0,
            "dojo-amd-factory-scan": 0,
            "dojo-combo-api": 0,
            "dojo-config-api": 1,
            "dojo-config-require": 0,
            "dojo-debug-messages": 0,
            "dojo-dom-ready-api": 1,
            "dojo-firebug": 0,
            "dojo-guarantee-console": 1,
            "dojo-has-api": 1,
            "dojo-inject-api": 1,
            "dojo-loader": 1,
            "dojo-log-api": 0,
            "dojo-modulePaths": 0,
            "dojo-moduleUrl": 0,
            "dojo-publish-privates": 0,
            "dojo-requirejs-api": 0,
            "dojo-sniff": 1,
            "dojo-sync-loader": 0,
            "dojo-test-sniff": 0,
            "dojo-timeout-api": 0,
            "dojo-trace-api": 0,
            "dojo-undef-api": 0,
            "dojo-v1x-i18n-Api": 1,
            "dom": 1,
            "host-browser": 1,
            "extend-dojo": 1
        },
       resourceTags: {
            copyOnly: function(filename, mid){
                return (/^app\/resources\//.test(filename) && !/\.css$/.test(filename));
                // Tag our copy only files
            },

            amd: function(filename, mid){
                return !copyOnly(filename, mid)
                    && /\.js$/.test(filename);
                // If it isn't a test resource, copy only,
                // but is a .js file, tag it as AMD
            },
            miniExclude: function(filename, mid){
                return /\/demos\//.test(mid);
            }
        },
        packages:[{
            name: "dojo",
            location: "dojo"
        },{
            name: "dijit",
            location: "dijit"
        },{
            name: "dojox",
            location: "dojox"
        }
        ],

        layers: {
            "dojo/dojo": {
                include: [ "dojo/dojo", "dojo/i18n", "dojo/domReady","dojo/parser","dojo/window", 'dojo/dom-geometry', 'dojo/dom-style',"dojo/_base/fx",'dojo/_base/declare','dojo/dom',"dojo/_base/window",'dojo/query',"dojo/_base/lang",'dojo/ready','dojo/_base/xhr'],
                customBase: true,
                boot: true
            },
            "dojo/dijit": {
                include: [ "dijit/layout/BorderContainer",'dijit/layout/ContentPane','dijit/layout/TabContainer',
            "dijit/form/Form", 'dijit/form/TextBox','dijit/form/Textarea', 'dijit/form/Select',
            'dijit/form/ValidationTextBox', 'dijit/form/Button',
            'dijit/layout/StackContainer','dijit/registry' ]
            },"dojo/dojox": {
                include: [ "dojox/grid/enhanced/plugins/Pagination",'dojox/data/QueryReadStore','dojox/grid/EnhancedGrid','dojo/data/ItemFileReadStore' ]
            }
        }
    };
})();

1 个答案:

答案 0 :(得分:0)

也许问题是你的报价在单引号和双引号之间混合了吗?

我的样本有

"dojo/dojo": {

作为

'dojo/dojo': {

也包括双引号