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 아래에 있으며 추가/업데이트된 모델/보기를 위해 제공됩니다.예를 들어, mySharequeue와 같이 새 Sharequeue 모델을 추가하면 다음과 같이 변경됩니다.
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
.예를 들어, mySharequeue와 같이 새 Sharequeue 모델을 추가하면 다음과 같이 변경됩니다.
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
축소된 main.js 및 registry.js를 사용하여 client-html/src/main/webapp/js 아래에 축소된 파일 폴더를 생성합니다.
NOTE
축소는 64비트 JVM에서만 작동합니다.
NOTE
축소하는 경우 업그레이드가 영향을 받습니다.
recommendation-more-help
a6ebf046-2b8b-4543-bd46-42a0d77792da