# dynamic import in Plugins

**URL:** <https://forum.shopware.com/t/dynamic-import-in-plugins/65465>\
**Category:** Programmierung\
**Created:** [12. März 2020 um 14:50 UTC](https://forum.shopware.com/t/dynamic-import-in-plugins/65465 "2020-03-12T14:50:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wall0t](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wall0t](https://forum.shopware.com/u/wall0t)\
**Post date:** [12. März 2020 um 14:50 UTC](https://forum.shopware.com/t/dynamic-import-in-plugins/65465/1 "2020-03-12T14:50:26Z")

</div>

Gitb es eine Möglichkeit, innerhalb&nbsp;eines Plugins mit dynamic imports zu arbeiten. In meiner main,js habe ich folgenden import, der zwar im HMR Modus funktionier, aber nicht wenn ich das Theme baue, weil dann natürlich der Pfad nicht stimmt. Frage mich ob das überhaupt (perspektivisch) in Shopware möglich ist.

```
if (document.querySelector('.js-animation-sync')) {
    import(/* webpackChunkName: "animationSync" */ './js/animation-sync');
}

```

-\>&nbsp;Loading chunk animationSync failed. (error: [http://shopware.local/testseite/undefined/js/animationSync.js](http://shopware.local/testseite/undefined/js/animationSync.js))&nbsp;  
&nbsp;
