[Resolved][html5] Chipmunk not loade by .min version of cocos2.2?

Hi
First: THANKS for CocosHtml : great work guys.

Here is my question:
when i use the minified version of cocos2.2 chipmunk does not get loaded.
I checked files locations etc etc… looks like the code never reaches the part in the .min file which replaces jsloader.js work.
thus not adding chipmunk.js to the javascript global space.

Is there something specific to do ?

thanks in advance

If your directory is the same as expanded files structure, you could just defined “chipmunk:true” in cocos2d.js. JSLoader will search the chipmunk file in the default path of ‘…/chipmunk/chipmunk.js’

If your directory is different from default structure, you could define it as: “chipmunk: …/…/balabala/chipmunk.js”. Then the JSLoader will search it in your custom path.

Look like this:

(function () {
    var d = document;
    var c = {
        COCOS2D_DEBUG:2, //0 to turn debug off, 1 for basic debug, and 2 for full debug
        box2d:false,
        chipmunk:' ../.../balabala/chipmunk.js',  //It defines your custom path.
        showFPS:true,
        frameRate:60,
        loadExtension:false,
        renderMode:0,       //Choose of RenderMode: 0(default), 1(Canvas only), 2(WebGL only)
        tag:'gameCanvas', //the dom element to run cocos2d on
        engineDir:'../cocos2d/',
        //SingleEngineFile:'',
        appFiles:[
            'src/resource.js',
            'src/myApp.js'//add your own files in order here
        ]
    };

Please refer to the JSLoader code in jsloader.js:

if(c.box2d || c.chipmunk){
            engine.push('physics_nodes/CCPhysicsSprite.js');
            engine.push('physics_nodes/CCPhysicsDebugNode.js');
            if (c.box2d === true)
                engine.push('../box2d/box2d.js');
            if (c.chipmunk === true)
                engine.push('../chipmunk/chipmunk.js');
        }
        engine.forEach(function (e, i) {
            engine[i] = c.engineDir + e;
        });
        if(typeof c.box2d === "string")
        {
            engine.push(c.box2d);
        }
        if(typeof c.chipmunk === "string")
        {
            engine.push(c.chipmunk);
        }

ok cool
did not see that the chipmunk boolean could be a string/path to a file! great idea.

For now what I did is have a “minified cocos” folder in my project with that structure:

cocos2d_min/
—chipmunk/
—~~chipmunk.js
—cocos2d/
—~~physics_nodes/
——CCPhysicsDebugNode.js
——CCPhysicsSprite.js
—lib/
—~~Cocos2d-html5-v2.2.min.js
—~~Cocos2d-html5-v2.2.max.js (for easier debugging)

Nick

Wo, Cocos2d-html5-v2.2.max.js. Good idea, guys!

Thx.
To do this I just use a code beautifier on the .min version et voila!