gpt4 book ai didi

maven - 有没有办法在没有 Sencha CMD 的情况下缩小 ExtJS 应用程序?

转载 作者:行者123 更新时间:2023-12-02 01:38:48 25 4
gpt4 key购买 nike

我有一个使用 ExtJS 4.2.1 开发的现有 ExtJS 应用程序。我通过 Maven 插件 minify-maven-plugin 使用 Closure minifier。生成的缩小 JS 文件(没有合并)工作正常。但是,生成的合并缩小文件会抛出未定义错误,因为定义稍后出现在合并文件中。我的问题是,有没有办法确定我必须提供插件的顺序? (我不想使用 Sencha Cmd)

app文件夹遵循结构

app/common, app/controller, app/model, app/proxy, app/store, app/utils, app/view

目前这就是我在 Maven POM 文件中定义构建过程的方式

<plugins>
<plugin>
<groupId>com.samaxes.maven</groupId>
<artifactId>minify-maven-plugin</artifactId>
<version>1.7.4</version>
<executions>
<execution>
<id>default-minify</id>
<phase>prepare-package</phase>
<goals>
<goal>minify</goal>
</goals>
<inherited>false</inherited>
<configuration>
<charset>UTF-8</charset>
<!-- <skipMerge>true</skipMerge> -->
<webappSourceDir>${basedir}/src/main</webappSourceDir>
<jsSourceDir>js/app</jsSourceDir>
<jsTargetDir>js/app</jsTargetDir>
<jsEngine>CLOSURE</jsEngine>
<closureLanguage>ECMASCRIPT5</closureLanguage>
<closureAngularPass>true</closureAngularPass>
<nosuffix>true</nosuffix>
<webappTargetDir>${project.build.directory}</webappTargetDir>
<jsSourceIncludes>
<jsSourceInclude>**/*.js</jsSourceInclude>
</jsSourceIncludes>
</configuration>
</execution>
</executions>
</plugin>

最佳答案

为什么不使用 Sencha Cmd?它完全符合您的要求!

如果您知道可以在没有 Sencha 应用程序结构的情况下使用 Sencha Cmd,也许会对您有所帮助。如果您只想合并文件,请使用 concatenate命令。

如果你真的不想使用 Sencha Cmd,那么你必须处理所有的扩展、要求、混合等......我不推荐这样做!

例如使用带有手动路径的 Sencha Cmd 并排除 extjs 类

sencha compile --classpath=myApp/src,extjs/src -debug=false exclude -all and include -namespace MyApp.* and concat bundle.js

extjs/src 路径是你的 extjs 类所在的路径

关于maven - 有没有办法在没有 Sencha CMD 的情况下缩小 ExtJS 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29565047/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com