AFAIK, the mage.confirm widget is defined in this file:


I'm looking to override the file in my theme to provide alternative default behaviour for confirm modals (e.g. the one displayed in M2 when removing an item from the minicart).

I've tried to customise the widget following the steps in the FE dev docs without success. Is it possible to override this base file?

  • Did you get the solution for your question, if ok please send the answer Sep 8, 2017 at 12:28

2 Answers 2


You could locate this file in you theme. As your original file is in:


Then create a folder:


This file will be catched during static-content deployment


try with:

map: {
  '*': {
    "Magento_Ui/js/modal/confirm":  "Vendor_Module/js/your-js-module"
  • Where i have to keep this code, Please let me know the file location Sep 8, 2017 at 12:25
  • In the main root of your theme: <Vendor>/<Theme>/requirejs-config.js
    – nuovecode
    Sep 11, 2017 at 8:50
  • "Magento_Ui/js/modal/confirm": "Vendor_Module/js/your-js-module" Sep 19, 2017 at 4:31
  • what is this "your-js-module" Sep 19, 2017 at 4:32
  • which module i have to give here Sep 19, 2017 at 4:32

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.