what is requirejs-config.js in Magento2?
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
2
down vote
favorite
Can any one tell that what is the difference between the keywords that are used in requirejs-config.js like 'map','paths','shim' and 'deps' please elaborate exact difference if possible with example?
var config =
"map":
'*':
,
"deps": [
],
"shim":
,
"paths":
,
;
magento2 requirejs-config.js
add a comment |Â
up vote
2
down vote
favorite
Can any one tell that what is the difference between the keywords that are used in requirejs-config.js like 'map','paths','shim' and 'deps' please elaborate exact difference if possible with example?
var config =
"map":
'*':
,
"deps": [
],
"shim":
,
"paths":
,
;
magento2 requirejs-config.js
For getting more information about require js & require config js concepts you have to try this alanstorm.com/magento_2_and_requirejs blog written by Alan. Thanks.
â Raj
10 mins ago
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Can any one tell that what is the difference between the keywords that are used in requirejs-config.js like 'map','paths','shim' and 'deps' please elaborate exact difference if possible with example?
var config =
"map":
'*':
,
"deps": [
],
"shim":
,
"paths":
,
;
magento2 requirejs-config.js
Can any one tell that what is the difference between the keywords that are used in requirejs-config.js like 'map','paths','shim' and 'deps' please elaborate exact difference if possible with example?
var config =
"map":
'*':
,
"deps": [
],
"shim":
,
"paths":
,
;
magento2 requirejs-config.js
magento2 requirejs-config.js
edited 1 hour ago
asked 1 hour ago
Charul Tyagi
45811
45811
For getting more information about require js & require config js concepts you have to try this alanstorm.com/magento_2_and_requirejs blog written by Alan. Thanks.
â Raj
10 mins ago
add a comment |Â
For getting more information about require js & require config js concepts you have to try this alanstorm.com/magento_2_and_requirejs blog written by Alan. Thanks.
â Raj
10 mins ago
For getting more information about require js & require config js concepts you have to try this alanstorm.com/magento_2_and_requirejs blog written by Alan. Thanks.
â Raj
10 mins ago
For getting more information about require js & require config js concepts you have to try this alanstorm.com/magento_2_and_requirejs blog written by Alan. Thanks.
â Raj
10 mins ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
Shim:
To build a dependency on the third-party plugin, specify a [shim] in the following configuration files:
requirejs-config.js
var config =
"shim":
"3-rd-party-plugin": ["jquery"]
;
Map:
Replace a default JS component
To use a custom implementation of an existing Magento JS component: Place the custom component source file in one of the following locations:
Your theme JS files: /web/js
or /_/web/js
Your module view JS files: /view/frontend/web/js
Create a RequireJS configuration file requirejs-config.js, having specified the following:
var config =
"map":
"*":
"<default_component>": "<custom_component>"
;
Deps:
Is used when your require js configurations depends upon some dependencies, i.e. you want to load some dependencies before your requires js define()âÂÂd is called.
example:
var config =
"deps": [
"jquery"
]
;
Here, It loads the [jquery] as soon as the require define()âÂÂd is called.
add a comment |Â
up vote
1
down vote
map: map is used to provide a prefix to a module with the different Id.
format of map configuration:
map:
'<module name>':
'<Id>': '<JS file>'
deps: Is used when your require js configurations depends upon some dependencies, i.e. you want to load some dependencies before your requires js define()âÂÂd is called.
var config =
"map":
'*':
'sample': 'sample1.js'
,
"deps": [
"jquery"
]
;
shim: It used when there are some scripts, to whome you want to declare globally, and those scripts not using define() to define values, if those scripts already used the define() then it will not work correctly.
examples:
var config =
"shim":
"sample":
"deps": ["jquery"],
"exports": webkulSample
For more details refer this link - https://webkul.com/blog/require-js-configurations/
Hope it helps !
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Shim:
To build a dependency on the third-party plugin, specify a [shim] in the following configuration files:
requirejs-config.js
var config =
"shim":
"3-rd-party-plugin": ["jquery"]
;
Map:
Replace a default JS component
To use a custom implementation of an existing Magento JS component: Place the custom component source file in one of the following locations:
Your theme JS files: /web/js
or /_/web/js
Your module view JS files: /view/frontend/web/js
Create a RequireJS configuration file requirejs-config.js, having specified the following:
var config =
"map":
"*":
"<default_component>": "<custom_component>"
;
Deps:
Is used when your require js configurations depends upon some dependencies, i.e. you want to load some dependencies before your requires js define()âÂÂd is called.
example:
var config =
"deps": [
"jquery"
]
;
Here, It loads the [jquery] as soon as the require define()âÂÂd is called.
add a comment |Â
up vote
1
down vote
accepted
Shim:
To build a dependency on the third-party plugin, specify a [shim] in the following configuration files:
requirejs-config.js
var config =
"shim":
"3-rd-party-plugin": ["jquery"]
;
Map:
Replace a default JS component
To use a custom implementation of an existing Magento JS component: Place the custom component source file in one of the following locations:
Your theme JS files: /web/js
or /_/web/js
Your module view JS files: /view/frontend/web/js
Create a RequireJS configuration file requirejs-config.js, having specified the following:
var config =
"map":
"*":
"<default_component>": "<custom_component>"
;
Deps:
Is used when your require js configurations depends upon some dependencies, i.e. you want to load some dependencies before your requires js define()âÂÂd is called.
example:
var config =
"deps": [
"jquery"
]
;
Here, It loads the [jquery] as soon as the require define()âÂÂd is called.
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Shim:
To build a dependency on the third-party plugin, specify a [shim] in the following configuration files:
requirejs-config.js
var config =
"shim":
"3-rd-party-plugin": ["jquery"]
;
Map:
Replace a default JS component
To use a custom implementation of an existing Magento JS component: Place the custom component source file in one of the following locations:
Your theme JS files: /web/js
or /_/web/js
Your module view JS files: /view/frontend/web/js
Create a RequireJS configuration file requirejs-config.js, having specified the following:
var config =
"map":
"*":
"<default_component>": "<custom_component>"
;
Deps:
Is used when your require js configurations depends upon some dependencies, i.e. you want to load some dependencies before your requires js define()âÂÂd is called.
example:
var config =
"deps": [
"jquery"
]
;
Here, It loads the [jquery] as soon as the require define()âÂÂd is called.
Shim:
To build a dependency on the third-party plugin, specify a [shim] in the following configuration files:
requirejs-config.js
var config =
"shim":
"3-rd-party-plugin": ["jquery"]
;
Map:
Replace a default JS component
To use a custom implementation of an existing Magento JS component: Place the custom component source file in one of the following locations:
Your theme JS files: /web/js
or /_/web/js
Your module view JS files: /view/frontend/web/js
Create a RequireJS configuration file requirejs-config.js, having specified the following:
var config =
"map":
"*":
"<default_component>": "<custom_component>"
;
Deps:
Is used when your require js configurations depends upon some dependencies, i.e. you want to load some dependencies before your requires js define()âÂÂd is called.
example:
var config =
"deps": [
"jquery"
]
;
Here, It loads the [jquery] as soon as the require define()âÂÂd is called.
answered 46 mins ago
Ansar Husain
1,408217
1,408217
add a comment |Â
add a comment |Â
up vote
1
down vote
map: map is used to provide a prefix to a module with the different Id.
format of map configuration:
map:
'<module name>':
'<Id>': '<JS file>'
deps: Is used when your require js configurations depends upon some dependencies, i.e. you want to load some dependencies before your requires js define()âÂÂd is called.
var config =
"map":
'*':
'sample': 'sample1.js'
,
"deps": [
"jquery"
]
;
shim: It used when there are some scripts, to whome you want to declare globally, and those scripts not using define() to define values, if those scripts already used the define() then it will not work correctly.
examples:
var config =
"shim":
"sample":
"deps": ["jquery"],
"exports": webkulSample
For more details refer this link - https://webkul.com/blog/require-js-configurations/
Hope it helps !
add a comment |Â
up vote
1
down vote
map: map is used to provide a prefix to a module with the different Id.
format of map configuration:
map:
'<module name>':
'<Id>': '<JS file>'
deps: Is used when your require js configurations depends upon some dependencies, i.e. you want to load some dependencies before your requires js define()âÂÂd is called.
var config =
"map":
'*':
'sample': 'sample1.js'
,
"deps": [
"jquery"
]
;
shim: It used when there are some scripts, to whome you want to declare globally, and those scripts not using define() to define values, if those scripts already used the define() then it will not work correctly.
examples:
var config =
"shim":
"sample":
"deps": ["jquery"],
"exports": webkulSample
For more details refer this link - https://webkul.com/blog/require-js-configurations/
Hope it helps !
add a comment |Â
up vote
1
down vote
up vote
1
down vote
map: map is used to provide a prefix to a module with the different Id.
format of map configuration:
map:
'<module name>':
'<Id>': '<JS file>'
deps: Is used when your require js configurations depends upon some dependencies, i.e. you want to load some dependencies before your requires js define()âÂÂd is called.
var config =
"map":
'*':
'sample': 'sample1.js'
,
"deps": [
"jquery"
]
;
shim: It used when there are some scripts, to whome you want to declare globally, and those scripts not using define() to define values, if those scripts already used the define() then it will not work correctly.
examples:
var config =
"shim":
"sample":
"deps": ["jquery"],
"exports": webkulSample
For more details refer this link - https://webkul.com/blog/require-js-configurations/
Hope it helps !
map: map is used to provide a prefix to a module with the different Id.
format of map configuration:
map:
'<module name>':
'<Id>': '<JS file>'
deps: Is used when your require js configurations depends upon some dependencies, i.e. you want to load some dependencies before your requires js define()âÂÂd is called.
var config =
"map":
'*':
'sample': 'sample1.js'
,
"deps": [
"jquery"
]
;
shim: It used when there are some scripts, to whome you want to declare globally, and those scripts not using define() to define values, if those scripts already used the define() then it will not work correctly.
examples:
var config =
"shim":
"sample":
"deps": ["jquery"],
"exports": webkulSample
For more details refer this link - https://webkul.com/blog/require-js-configurations/
Hope it helps !
answered 58 mins ago
Manthan Dave
7,40421336
7,40421336
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f243416%2fwhat-is-requirejs-config-js-in-magento2%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
For getting more information about require js & require config js concepts you have to try this alanstorm.com/magento_2_and_requirejs blog written by Alan. Thanks.
â Raj
10 mins ago