Magento 2 Add custom js backend and frontend


#1

Magento 2:

I am not able to add the custom js file

Step 1: Gaurav/Sharma/view/frontend/requirejs-config.js

var config = {
map: {
‘*’: {
mycomponent: ‘Gaurav_Sharma/js/flexslider’
}
}
};

Step 2: code/Gaurav/Sharma/view/frontend/web/js/gs-frontyy.js

require([‘jquery’],function($){

$(document).ready(function(){

   alert('ok');

});

});

Please me how we can add custom js file.


#2

I’m not sure what Magento 2 is. This forum is for discussion about the code editor Atom and the application framework Electron.