python ruby-programming-language Smalltalk Vue.js Knockoutjs TypeScript JavaScript, OOPs JavaScript Angular 7, Interview Questions Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 4 Angular 2 AngularJs 1.x NodeJs Perl Programming R Programming RequireJs Rust Programming Backbonejs closure programming language go-programming-language kotlin-programming-language
Features of RequireJS?

What Is config function in RequireJS?

What Is config function?
The RequireJS can be initialized by passing the main configuration in the HTML template through the data-main attribute.

If you want to update the RequireJS configuration values with your own configurations value. You can do using therequirejs.config function. 

The configurations options -
ü  config - This is for configuration to a module by using the config option
ü  baseUrl -This is the root path to start the loading of modules.
ü  paths - this is the path mapping for modules that don’t exists in under the base URL.
ü  Shims - This is use for configuration for dependencies.
ü  deps  - array of dependencies to load
ü  map  -
ü  urlArgs -This is the query string arguments are used to fetch all resources that are loaded by using RequireJS.
ü  callback -It executes a function after loading the dependencies and is required when Require is specified as config object before loading RequireJS.
ü  xhtml - It is used to create the script elements by using the document.createElementNS() method.
ü  scriptType - It defines the value for script type attribute used in the document. Default type is "text/javascript".

Example looks like-
require.config({
    baseUrl: 'scripts/app',
    paths: {
        lib: '../lib'
    },
    shim: {
        'backbone': {
            deps: ['underscore'],
            exports: 'Backbone'
        }
    }
});

I hope you are enjoying with this post! Please share with you friends!! Thank you!!!
ANIL SINGH

Hi there! Welcome to my blog. My name is Anil Singh. I'm a author of this blog. For more detail about me, kindly refer to this link..
My Blogs - http://code-sample.com and http://code-sample.xyz
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like
www.code-sample.com/. Powered by Blogger.
ASK Questions