Enonic XP + Requirejs

Enonic version: XP 6.3.1
OS: Ubuntu

Does anyone have experience using requirejs with Enonic XP.

I’m getting this error trying to load a page when reuirejs is used


I experimented with RequireJS in my apps when XP was released, and noticed that this broke the Live edit mode. If I remember correctly, some plugins that are used by XP admin are instantiated in another mode when requirejs / amd code is present. As far as I know, some extensive rewriting of the admin is required to avoid this.

I don’t know if this helps you, but I have started using Webpack to handle front end JS dependencies in my apps. Gradle triggers a Gulp plugin that handles this (along with other front end automation), and it works like a charm.You can check it out in the Gulp Starter that will be released soon:

Ok, Then RequireJS is off the map. I’ll look into you’re suggestion


@tlo: Is this just a RequireJS-issue, or will it affect other client side-generated code as well? (Thinking React, Angular, etc)

@it_vegard Angular works, we’re using it in a project.

1 Like

I’m using React with webjars and Babel to compile the jsx. I should write a labs article about how to do it some day soon.

1 Like