JavaScript檔案的縮制 minification-of-the-javascript-files
縮制會從原始碼中移除多餘的字元,例如空白字元、新行和註解。 這可以縮小程式碼的大小,進而改善效能。 縮制不會影響功能,但會降低程式碼的可讀性。
要生成語義更改的縮制代碼,請執行以下步驟。
-
複製
client-html/src/main/webapp/js
從檔案系統上的src-package。note note NOTE 請參閱 自訂AEM Forms工作區簡介 以取得套件的詳細資訊。 -
更新
main.js
位於client-html/src/main/webapp/js下,以取得已新增/更新的模型/檢視。例如,添加新的Sharequeue模型(如mySharequeue),請更改:
code language-none sharequeuemodel : pathprefix + 'runtime/models/sharequeue', To sharequeuemodel : pathprefix + 'runtime/myModels/mySharequeue',
-
更新
registry-config.xml, located at client-html/src/main/webapp/js/resource_generator,
若main.js
.例如,添加新的Sharequeue模型(如mySharequeue),請更改:
code language-xml <sharequeue name="sharequeue" path="runtime/models/sharequeue.js" service="service"/> To <sharequeue name="sharequeue" path="runtime/myModels/mySharequeue.js" service="service"/>
-
在client-html/src/main/webapp/js/minifier上,運行命令:
code language-shell mvn clean install
它會在client-html/src/main/webapp/js下產生一個資料夾縮制檔案,其中包含縮制的main.js和registry.js。
NOTE
縮制只能在64位元JVM上運作。
NOTE
如果您縮制,升級會受到影響。
recommendation-more-help
a6ebf046-2b8b-4543-bd46-42a0d77792da