Search code examples
extjssencha-cmd

How to build ExtJS app into .js file, not inside index.html?


I have Ext JS app (5.0, MVC) which need to be placed inside DIV container in HTML page. Everything works in development environment, but i can't understand how to use sencha cmd to build it, because build process generates "launcher" code and places it inside index.html When i copy/paste builded JS code into my template - it works fine.

So, question is: can i somehow redirect build JS output into .js file, which i'll include (with <source>) in my HTML, so i'll do not need to copy/paste JS code everytime i rebuilded app?

Thanks.


Solution

  • After some experimenting found it myself:

    app.json

    "output": { "base": "${workspace.build.dir}/${build.environment}/${app.name}", "microloader": { "path": "microloader.js", "embed": false, "enable": true } },

    and <script src="microloader.js"></script> in my template.

    index.html still will be overwritten on every build, but doesn't matter for me.