0

We are using OCC platform for our E-Commerce site which uses require.js to load the modules, We need to load backbone and Underscore.js but when we use both the library we get the error that Underscore.js and Backbone.js are not a valid require.js module.

Has anyone tried here to load backbone.js and Underscore using Require.js ??

RAVI singh
  • 158
  • 2
  • 15
  • 1
    Possible duplicate of [Loading Backbone and Underscore using RequireJS](https://stackoverflow.com/questions/8131265/loading-backbone-and-underscore-using-requirejs) – hashchange Aug 13 '18 at 15:02
  • 1
    We are using Oracle commerce cloud as a platform, we can't write shim configurations. All we can do is to upload the Javascript files in valid require format. That is not working for me. – RAVI singh Aug 13 '18 at 15:46

1 Answers1

0

Here is source containing AMD support of latest version of backbone.js#L16 and underscore.js#L1687

So if the environment in which these files are loaded actually has require.js as you claim, which contains define, then all you need to do is use the latest versions and the libraries should export themself as AMD modules.

If that is not happening I suggest contacting OCC platform support (if there is such thing) and explain the scenario.

T J
  • 42,762
  • 13
  • 83
  • 138