0

I am doing theme integretion. I have included the bootstrap.min.js file in requirejs-config.js

in requirejs-config.js file

 var config = {

 map: {
    '*': {
        'jqueryjs': 'India_Newtheme/js/jquery',
        'bootstrapmin': 'India_Newtheme/js/vendor/bootstrap.min',
        //'bootstrapselect_min': 'India_Newtheme/js/bootstrap-select.min',            
        'scripts': 'India_Newtheme/js/scripts',
        //'jquery_dtpicker': 'India_Newtheme/js/jquery.simple-dtpicker',
        //'jquery_wizard': 'India_Newtheme/js/jquery.smartWizard',
        'html5shivmin': 'India_Newtheme/js/html5shiv.min',    
       // 'scripts1': 'India_Newtheme/js/scripts1'
    }
},
paths: {            
        'jqueryjs': 'India_Newtheme/js/jquery',
        'bootstrapmin': 'India_Newtheme/js/vendor/bootstrap.min',          
        'scripts': 'India_Newtheme/js/scripts',
        //'jquery_dtpicker': 'India_Newtheme/js/jquery.simple-dtpicker',
       // 'jquery_wizard': 'India_Newtheme/js/jquery.smartWizard',
        'html5shivmin': 'India_Newtheme/js/html5shiv.min',    
       // 'scripts1': 'India_Newtheme/js/scripts1',
       // 'priceform': 'India_Newtheme/js/priceForm',
        'animated': 'India_Newtheme/js/animated'
},
shim: {

'jqueryjs': {
    deps: ['jquery']
},

'bootstrapmin': {
    deps: ['jquery']
},

/*'bootstrapselect_min': {
    deps: ['jquery']
},

'jquery_wizard': {
    deps: ['jquery']
},
'jquery_dtpicker': {
    deps: ['jquery']
},
*/
'scripts': {
    deps: ['jquery']
},

'html5shivmin': {
    deps: ['jquery']
},
/*'scripts1': {
    deps: ['jquery']
},
'priceform':{
    deps: ['jquery']
},*/
'animated':{
    deps: ['jquery']
}}}

It is not taking the bootstrap.min file and any other js file at all.How to integrate external js with Magento theme.Kindly help me on this

0
  1. bootstrap.min.js should be in : app/design/frontend/{Vendor}/{theme}/Magento_Theme/web/js/bootstrap/bootstrap.min.js

  2. requirejs-config.js should be in : app/design/frontend/{Vendor}/{theme}/requirejs-config.js

    var config = {
        deps: [
            'js/output'
        ],
        paths: {
            'bootstrap': 'Magento_Theme/js/bootstrap/bootstrap.min',
        },
        shim: {
            'bootstrap': {
                'deps': ['jquery']
            }
        }
    };
    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.