Disable ES6 to ES5 Clientlib Preprocessor? | Community
Skip to main content
June 13, 2023
Solved

Disable ES6 to ES5 Clientlib Preprocessor?

  • June 13, 2023
  • 2 replies
  • 1385 views

Hello.

 

After updating from AEM 6.5.11 to AEM 6.5.17, some of our Clientlibs for dialogue extensions are no longer working. The cause appears to be that we have ES6 code, which has run flawlessly in browsers so far, but seems to be transformed into ES5 after the update. Unfortunately, the result is not fully functional. As we do not want to rewrite the working ES6 code - how can I turn off this preprocessor?

 

Thank you.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by MayurSatav

Hi @is24tom ,

 

In AEM 6.5, the JavaScript files are transpiled from ES6 to ES5 using a preprocessor called Babel by default. This is done to ensure compatibility with older browsers that may not support ES6 syntax. If you want to disable this preprocessor and use your ES6 code directly without transformation, you can follow below steps:

  1. Inside the definition file, look for the jsProcessor property. It is set to default by default, which indicates that Babel is used for transpiling.

  2. Change the value of the jsProcessor property to none. This disables the preprocessor and prevents the ES6 to ES5 transformation.

2 replies

MayurSatav
Community Advisor and Adobe Champion
MayurSatavCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
June 13, 2023

Hi @is24tom ,

 

In AEM 6.5, the JavaScript files are transpiled from ES6 to ES5 using a preprocessor called Babel by default. This is done to ensure compatibility with older browsers that may not support ES6 syntax. If you want to disable this preprocessor and use your ES6 code directly without transformation, you can follow below steps:

  1. Inside the definition file, look for the jsProcessor property. It is set to default by default, which indicates that Babel is used for transpiling.

  2. Change the value of the jsProcessor property to none. This disables the preprocessor and prevents the ES6 to ES5 transformation.

IS24TomAuthor
June 13, 2023

I had already tried that. However, without success. Moreover, this came with the last update from 6.5.11 to 6.5.17.

IS24TomAuthor
June 13, 2023

I probably don't know something, because I changed 

categories="[cq.authoring.dialog]"

 to

categories="[cq.authoring.dialog.all]"

it works. Is there some magic behind the dialog categories, that I should know? 

TarunKumar
Community Advisor
Community Advisor
June 13, 2023

Hi @is24tom ,

You can override the default aem minification by adding following property in ClientLibraryFolder:

jsProcessor="[default:none,min:none]"