What is the purpose of the view/base in magento2 modules ?


This area is common for adminhtml and frontend areas. For example: you have styles and scripts files which are identical for frontend and backend. You can place them in base area folder to avoid copy-paste.

  • How would you extend an xml file sourcing from base affecting only frontend output? (from app/..) ?? – OZZIE Feb 6 '17 at 10:38

The base folder is an area to share for client side resources (less, js, images, etc.), layouts, templates, etc., between the frontend and adminhtml areas. For example, if you want to use the same js library between the frontend and adminhtml area, you would put it in view/base/web/js/lib/your-library.js. If you were to add that library to the frontend directory, it would not be accessible from adminhtml and vice versa.

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.