JavaScript 파일 축소 minification-of-the-javascript-files

축소하면 소스 코드에서 공백, 새 줄 및 설명과 같은 중복 문자가 제거됩니다. 이렇게 하면 코드 크기를 줄여 성능이 향상됩니다. 축소는 기능에 영향을 주지 않지만 코드의 가독성을 낮춥니다.

의미 체계 변경에 대해 축소된 코드를 생성하려면 다음 단계를 수행합니다.

  1. 복사 client-html/src/main/webapp/js 파일 시스템의 src-package에서

    note note
    NOTE
    다음을 참조하십시오 AEM Forms 작업 영역 사용자 정의 소개 패키지를 참조하십시오.
  2. 에서 경로 업데이트 main.js 추가된/업데이트된 모델/보기에 대해 client-html/src/main/webapp/js 아래에 있습니다.

    예를 들어, 새로운 Sharequeue 모델, 즉 mySharequeue를 추가하면 변경됩니다.

    code language-javascript
    sharequeuemodel : pathprefix + 'runtime/models/sharequeue',
    

    code language-javascript
    sharequeuemodel : pathprefix + 'runtime/myModels/mySharequeue',
    
  3. 업데이트 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"/>
    

    code language-xml
    <sharequeue
                name="sharequeue"
                path="runtime/myModels/mySharequeue.js"
                service="service"/>
    
  4. 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
19ffd973-7af2-44d0-84b5-d547b0dffee2