I try to include external JS (fabric.js)
in my custom module.
I try so many different way but still not getting success. i don't understand what i missing below is my code.
- Add external JS
(fabric.js)
under<Vendor>/<Module_Name>/view/<adminhtml>/web/js/fabric.js
- Create
requirejs-config.js
under<Vendor>/<Module_Name>/view/<adminhtml>/requirejs-config.js
Add following code to requirejs-config.js
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
var config = {
map: {
'*': {
fabric: 'Namespace_Modulename/js/fabric'
}
}
};
I followed below link to achieve my thing but still not get success.
- magento.stackexchange.com/questions/131056
- magento.stackexchange.com/questions/101671
- magento.stackexchange.com/questions/85851
Any other way to include external JS.
Any help would be appreciated! Thanks.
require
ordefine
function? – LucScu Oct 27 '18 at 9:11shim
but no luck – Chirag Patel Oct 27 '18 at 9:15requirejs-config.js
is not required, it is only used to set the requirejs settings. – LucScu Oct 27 '18 at 9:16