Extjs Sencha Cmd 3.0.0.250:替换Sencha编译输出文件名;“所有类.js”;有定制的吗
Extjs Sencha Cmd 3.0.0.250:替换Sencha编译输出文件名;“所有类.js”;有定制的吗,extjs,compiler-construction,command,Extjs,Compiler Construction,Command,sencha compile page命令连接HTML页面所需的任何javascript文件,然后将结果写入名为“all class.js”的单个文件。我想用自定义文件名替换此文件名: sencha compile page -name=page1 -in Page1.php -out build/Page1.php and page -name=page2 -in Page2.php -out build/Page2.php and restore page1 and concat -yui
sencha compile page
命令连接HTML页面所需的任何javascript文件,然后将结果写入名为“all class.js”的单个文件。我想用自定义文件名替换此文件名:
sencha compile
page -name=page1 -in Page1.php -out build/Page1.php and
page -name=page2 -in Page2.php -out build/Page2.php and
restore page1 and
concat -yui build/Page1.js and
restore page2 and
concat -yui build/Page2.js
干杯,我在寻找同样的答案。我只有一个提示,还没有一个最佳实践 在.sencha/app/build-impl.xml文件中,存在以下目标:
<!-- compile the page -->
<x-sencha-command>
compile
${build.options}
page
-name=page
-in=index.html
-out=${build.dir}/index.html
and
restore
page
and
${build.operations}
and
concat
${build.compression}
-out=${build.dir}/all-classes.js
</x-sencha-command>
编译
${build.options}
页
-名称=第页
-in=index.html
-out=${build.dir}/index.html
和
恢复
页
和
${build.operations}
和
海螺
${build.compression}
-out=${build.dir}/all-classes.js
正如您所见,“allclasses.js”是在这里定义的
我在这里尝试了改变,它。。。他工作了一半。
1) 它确实用新名称创建了min.js文件。
2) 它没有用正确的路径更新index.html(您必须这样做)
但是,这可能不是最佳实践—据我所知—在build-impl.xml中维护修改可能不好,因为从sencha升级的角度来看,这可能会导致复杂性
也许会有一个sencha.cfg设置?那当然很好
谢谢你的提问+1.我希望其他人作出回应。
祝你一切顺利 我找到了一个简单的解决方案,作为名为
--classes file
(-cla
)的命令提供的选项:
谢谢你的回复。我没有名为“build impl.xml”的文件,因为我的应用程序不是通过sencha cmd生成的。无论如何,sencha cmd提供了一个简单的选项来完成这项工作。请看我自己的答案以了解详细信息。享受:)谢谢,我来看看。我发现sencha cmd对于脚手架环境和扩展构建非常灵活。你的解决方案太棒了,我得复习一下+1.祝你一切顺利。
sencha compile
page -name=page1 -cla Page1.js -in Page1.php -out build/Page1.php and
page -name=page2 -cla Page2.js -in Page2.php -out build/Page2.php and
restore page1 and
concat -yui build/Page1.js and
restore page2 and
concat -yui build/Page2.js