6

We got M2E pro installed on Magento 2.1.1. After enabling js Bundling under Config > Developer we have a not defined error on all m2e pro js.

Wondering is there any way how to exclude M2E pro related js from bundling? Or is it possible to bundle js only on frontend and exclude backend?

I tried to add following item to exclude list in theme::view.xml, but that did not work

<item type="directory">app/code/Ess/M2ePro/view/adminhtml/web/js</item>

Any advice will be much appreciated.

1 Answer 1

4
+50

If you want to exclude the js in Admin from Js bundling, we need to create a new backend admin: How to enable custom admin theme in Magento 2

In our custom view, add the exclude tag with our js:

app/design/adminhtml/{yourpackage}/{yourtheme}/etc/view.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
    <exclude>
        <item type="directory">Ess_M2ePro::js</item>
    </exclude>
</view>

The same way if we want to exclude Js on the front page.

Read more about the exclude tag.

2
  • 2
    Does not work for Magento 2.4.2 (note that the answer is from 2016)
    – Black
    Commented Nov 3, 2022 at 13:53
  • It is still valid in magento2.4.5 Official Link
    – M2 Dev
    Commented Oct 15 at 4:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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