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

淺唱寂寞╮ 提交于 2021-01-25 06:34:32

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/26589840/how-to-build-extjs-app-into-js-file-not-inside-index-html

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