설명서AEM 6.5사용 안내서

JavaScript 파일 축소

마지막 업데이트: 2024년 7월 15일
  • 적용 대상:
  • Experience Manager 6.5
  • 주제:
  • 응용 양식

작성 대상:

  • 사용자
  • 개발자

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

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

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

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

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

    sharequeuemodel : pathprefix + 'runtime/models/sharequeue',
    

    끝

    sharequeuemodel : pathprefix + 'runtime/myModels/mySharequeue',
    
  3. main.js에 별칭이 변경/추가된 경우 registry-config.xml, located at client-html/src/main/webapp/js/resource_generator,을(를) 업데이트합니다.

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

    <sharequeue
                name="sharequeue"
                path="runtime/models/sharequeue.js"
                service="service"/>
    

    끝

    <sharequeue
                name="sharequeue"
                path="runtime/myModels/mySharequeue.js"
                service="service"/>
    
  4. client-html/src/main/webapp/js/minifier에서 다음 명령을 실행합니다.

    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