Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

AEM6 and Commonjs

Avatar

Level 1

Hi everybody,

I would like to know if it's possible to use Commonjs in the front end? Here's an example:

var hello = require('hello'); module.exports = hello() + 'world';

I'm not a big fan or AMD and the JavaScript use API provided. 

Commonjs in the front end usually requires a build step and I was also wondering if AEM is flexible enough to allow custom/external builds for JS and CSS  (no css.txt or js.txt)

Thanks in advance

1 Accepted Solution

Avatar

Correct answer by
Level 10

Out of the box does not provide & not seen personally any implementation so far.  Technically it will work & you might face some challenges specifically with css since is no cross-browser onload event for CSS.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

Out of the box does not provide & not seen personally any implementation so far.  Technically it will work & you might face some challenges specifically with css since is no cross-browser onload event for CSS.