This topic contains 1 reply, has 0 voices, and was last updated by chanarbon 7 years, 8 months ago.

  • Author
    Posts
  • #1305

    CREECE

    We’ve run into an issue where we have a custom module that has momentjs and are trying to use this custom module in another module. If we try to include this using require.config with a relative path to the custom module, it does not allow it (says it cannot find the module). If we take out the reference to momentjs so the define is something like define([], function({…}); then it’ll work fine. However, if we keep momentjs as a dependency and do NOT use require.config and just use a relative path within the define array, it works just fine. My thought is that require.config and just adding a path in define array should have the same functionality yet it clearly does not as the require will fail. Anyone know why this is? is this a bug?
    This is a cached copy. Click here to see the original post.

  • #1306

    chanarbon

    Hi Chris,

    When you added it on require.config() e.g.

    Code:
    require.config({
    paths : {
    moment : “”
    }
    })

    define([‘moment’,…], function(moment, …){….})
    Have you referred the alias to the momentjs?

You must be logged in to reply to this topic.