I want to override Magento 2 html template located at


I tried using require-config.js for frontend like this:

var config = { 
    map: {
       '*': {

and I put that file at


But I got the following error:

Unable to resolve the source file for 'frontend/Vendor/vendor_theme/en_US/Namespace_Module/template/billing-address/details.html' #0 /var/www/rotoki/vendor/magento/framework/App/StaticResource.php(97)

I think Magento is trying to find that file inside my theme folder instead of my module folder.

  • please let me know if i have use custom module then how override? – Magento2 Devloper Aug 2 '17 at 7:14

Just copy file from


And put it to


Run below commads for deploy static content

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento cache:clean
  • Thanks, I had seen advice elsewhere that leaves out the '/web/' part of the path in the custom theme. Putting 'template' folder in 'web' made the override work 👍 – 00-BBB Aug 30 at 9:41

You should give first priority to custom module for override html template files and give second priority to custom theme

To override html file with a custom theme you need not require-config.js.

As you question you use custom module to override html files that's good.

Check your path you need to copy in details.html at


After flush cache and refresh page, details.html is created or copied in pub/static folder at


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.