I am have installed jQuery using NPM. Now I am adding this into my externals section as:
"externals": {
"jQuery": {
"path": "/node_modules/jquery/dist/jquery.min.js",
"globalName": "jQuery1"
}
}
Now I have installed unitegallery for carousel and other beautiful controls. I have installed unitegallery through NPM. I have added the dependency as below:
"externals": {
"jQuery": {
"path": "/node_modules/jquery/dist/jquery.min.js",
"globalName": "jQuery1"
},
"UniteGallery": {
"path": "/src/webparts/carouselControl/unitegallery.min.js",
"globalName": "UniteGallery",
"globalDependencies": ["jQuery"]
}
}
When I load them in my .ts file as require('jQuery')
and require('UniteGallery')
, it is gives an error as
Resource "jQuery" not found in loader configuration of manifest for component
. I am really vexed to find solution. All blogs are saying this is the only way to do. But why it is giving error to me? What I am doing wrong here?