3

We already have a AMD implementation with require.js which is being used for a long time and now team has decided to use r.js optimizer to optimize the build. I am following the steps but I think I am missing something:

We have require.config which looks like the following:

require.config({
    waitSeconds : 15,
    baseUrl: window.rootPath + 'scripts',
    paths: {
        jquery: 'empty:',
        jqueryui: 'empty:',
        recaptcha: '//www.google.com/recaptcha/api/js/recaptcha_ajax',
        maxmind: '//j.maxmind.com/app/geoip',
        enduser: '/enduser/scripts/system',
        cookies: '/enduser/scripts/system/cookies',
        errorhandler: '/enduser/scripts/system/errorhandler',
        underscore: '/enduser/scripts/underscore',
        blockui: '/enduser/scripts/jquery.blockui',
        messaging: '/enduser/scripts/system/messaging',
        jgrowl: '/enduser/scripts/jquery.jgrowl',
        knockout: 'knockout-latest.debug',
        kobindings: '/enduser/scripts/system/bindings',
        async: 'plugins/require/async',
        depend: 'plugins/require/depend',
        font: 'plugins/require/font',
        goog: 'plugins/require/goog',
        image: 'plugins/require/image',
        json: 'plugins/require/json',
        noext: 'plugins/require/noext',
        mdown: 'plugins/require/mdown',
        propertyParser: 'plugins/require/propertyParser',
        markdownConverter: 'lib/Markdown.Converter'
    },
    priority: ['jquery']
});

require(["main"]);

Please note that it has CDN paths instead of "empty". But I replaced empty there after reading some threads online. I am running following command on that:

node -o name="filepath" output="output file path"

It's saying tracing dependencies and then it throws an error saying it did not find jquery.js. Any suggestions?

1
  • Well basically the solution to this was to include paths.jquery=empty: at the end of the command. so my command looks like node -o name="filepath" output="output file path" paths.jquery=empty:. This also applies to any CDN that you are using including Jquery. Commented Jul 27, 2012 at 18:15

1 Answer 1

3

Well basically the solution to this was to include paths.jquery=empty: at the end of the command. so my command looks like node -o name="filepath" output="output file path" paths.jquery=empty:. This also applies to any CDN that you are using including Jquery.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.