缩小会从源代码中删除冗余字符,如空格、新行和注释。 这会通过减小代码大小来提高性能。 虽然缩小不会影响功能,但会降低代码的可读性。
要生成缩小的代码以进行语义更改,请执行以下步骤。
从文件系统上的src-package复制client-html/src/main/webapp/js
。
有关包的更多详细信息,请参阅自定义AEM Forms工作区简介。
更新main.js
中位于client-html/src/main/webapp/js下的路径,以获取已添加/已更新的模型/视图。
例如,添加了新的“共享队列”模型(如mySharequeue),请更改:
sharequeuemodel : pathprefix + 'runtime/models/sharequeue',
收件人
sharequeuemodel : pathprefix + 'runtime/myModels/mySharequeue',
如果main.js
中存在别名的更改/添加,请更新registry-config.xml, located at client-html/src/main/webapp/js/resource_generator,
。
例如,添加了新的“共享队列”模型(如mySharequeue),请更改:
<sharequeue
name="sharequeue"
path="runtime/models/sharequeue.js"
service="service"/>
收件人
<sharequeue
name="sharequeue"
path="runtime/myModels/mySharequeue.js"
service="service"/>
在client-html/src/main/webapp/js/minifier中,运行命令:
mvn clean install
它会在client-html/src/main/webapp/js下生成一个文件夹,其中包含缩小的main.js和registry.js。
缩小仅适用于64位JVM。
如果您缩小,则升级会受到影响。