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 ??

2
  • 1
    Possible duplicate of Loading Backbone and Underscore using RequireJS
    – hashchange
    Commented Aug 13, 2018 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
    Commented Aug 13, 2018 at 15:46

1 Answer 1

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.