如何将ExtJS应用程序构建到.js文件中,而不是在index.html中? [英] How to build ExtJS app into .js file, not inside index.html?

查看:59
本文介绍了如何将ExtJS应用程序构建到.js文件中,而不是在index.html中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Ext JS应用程序(5.0,MVC),需要将其放置在HTML页面的DIV容器内.一切都在开发环境中工作,但是我不明白如何使用sencha cmd进行构建,因为构建过程会生成启动器"代码并将其放置在index.html中当我复制/粘贴将JS代码粘贴到模板中时-可以正常工作.

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.

所以,问题是:我可以以某种方式将生成的JS输出重定向到.js文件中,该文件将包含在HTML中(与< source>一起使用),因此我不需要每次都复制/粘贴JS代码.我重建了应用程序?

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?

谢谢.

推荐答案

经过一些实验,我自己发现了它:

After some experimenting found it myself:

app.json

输出":{"base":"$ {workspace.build.dir}/$ {build.environment}/$ {app.name}",微型装载器":{"path":"microloader.js",嵌入":错误,启用":true}},

和我的模板中的< script src ="microloader.js"></script> .

index.html仍然会在每个版本上被覆盖,但对我而言无关紧要.

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

这篇关于如何将ExtJS应用程序构建到.js文件中,而不是在index.html中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆