Instruct Sencha SDK tools to bundle other js files specified in app.json

你。 提交于 2019-12-02 19:42:02

After looking at the source code and talking with the devs behind Cmd, it appears that it is currently not possible.

However, because the build file is written in JavaScript, in theory, it wouldn't take much to modify it and add this functionality into Cmd.

You can find the Sencha Touch build file in:

CMD-ROOT/plugins/touch/current/app-build.js

Where CMD-ROOT is the location of the sencha command - which you can find out by using which sencha.

On my system (OSX), the path is:

/Users/Robert/bin/Sencha/Cmd/3.0.0.250/plugins/touch/current/app-build.js

Hopefully this is of some help to you.

Update

It appears that, after talking to another Cmd developer, this actually is possible. There are 2 steps you need to take to make it happen:

1) Add the skipFrameworkFile property into each JS resource you want to bundle. This tells the compiler to not copy the resource when your build your app.

{
    "path": "resources/js/jquery.js",
    "skipFrameworkFile": true
},

    "path": "resources/js/jquery2.js",
    "skipFrameworkFile": true
}

2) Require each of the files in your app.js file using the @require tag. This tells the compiler to include each of your files into your app.js file.

//@require resources/js/jquery.js
//@require resources/js/jquery2.js

For SenchaCmd 3.2, rdougan's solution didn't work for me. However, instead of using:

'skipFrameworkFile: true

I used

'x-bootstrap': true

(by looking at SenchaCmd source code) and it worked!

The other steps are the same as rdougan's

Hope this helps. Cheers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!