# Javascript in Plugin einbinden

**URL:** <https://forum.shopware.com/t/javascript-in-plugin-einbinden/72206>\
**Category:** Allgemein\
**Created:** [19. Januar 2021 um 19:20 UTC](https://forum.shopware.com/t/javascript-in-plugin-einbinden/72206 "2021-01-19T19:20:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![FloC3](https://avatars.discourse-cdn.com/v4/letter/f/838e76/32.png) [@FloC3](https://forum.shopware.com/u/FloC3)\
**Post date:** [19. Januar 2021 um 19:20 UTC](https://forum.shopware.com/t/javascript-in-plugin-einbinden/72206/1 "2021-01-19T19:20:32Z")

</div>

Hallo,

wie krieg ich denn Javascript in ein Plugin? In einem Theme kann ich JS-Files ja über die theme.json einbinden.

aber wie gehts in einem Plugin wo es keine theme.json gibt?

---

<div class="post-metadata">

**Author:** ![sschreier](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/sschreier/32/23296_2.png) [@sschreier](https://forum.shopware.com/u/sschreier)\
**Post date:** [20. Januar 2021 um 19:06 UTC](https://forum.shopware.com/t/javascript-in-plugin-einbinden/72206/2 "2021-01-20T19:06:30Z")

</div>

Hallo,

das ist eigentlich sehr gut in der Shopware - Dokumentationen beschrieben, siehe:&nbsp;[Shopware 6: Using custom CSS and JavaScript in the Storefront](https://docs.shopware.com/en/shopware-platform-dev-en/how-to/storefront-assets) .

Speziell:&nbsp;In Shopware 6, this entry-point is a&nbsp; **`main.js`** &nbsp;file inside of the following directory:&nbsp;`/src/Resources/app/storefront/src.`

Grüße

Sebastian

---

<div class="post-metadata">

**Author:** ![FloC3](https://avatars.discourse-cdn.com/v4/letter/f/838e76/32.png) [@FloC3](https://forum.shopware.com/u/FloC3)\
**Post date:** [21. Januar 2021 um 07:47 UTC](https://forum.shopware.com/t/javascript-in-plugin-einbinden/72206/3 "2021-01-21T07:47:31Z")

</div>

ja hab die Doku schon gesehen.

Aber da muss ich dann wieder mit&nbsp;

```
storefront:build

```

rumhantieren. Und das funktioniert einfach nicht … bei Production ohnehin nicht&nbsp;

---

<div class="post-metadata">

**Author:** ![sschreier](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/sschreier/32/23296_2.png) [@sschreier](https://forum.shopware.com/u/sschreier)\
**Post date:** [21. Januar 2021 um 08:02 UTC](https://forum.shopware.com/t/javascript-in-plugin-einbinden/72206/4 "2021-01-21T08:02:59Z")

</div>

Hallo,

das ist aber der “way to go”. Im production - Template gibt es storefront build genauso, siehe:&nbsp;[production/build-storefront.sh at 6.3 · shopware/production · GitHub](https://github.com/shopware/production/blob/6.3/bin/build-storefront.sh) . Und damit funktioniert das auch.

Grüße

Sebastian

---

<div class="post-metadata">

**Author:** ![FloC3](https://avatars.discourse-cdn.com/v4/letter/f/838e76/32.png) [@FloC3](https://forum.shopware.com/u/FloC3)\
**Post date:** [21. Januar 2021 um 08:46 UTC](https://forum.shopware.com/t/javascript-in-plugin-einbinden/72206/5 "2021-01-21T08:46:03Z")

</div>

ich hatte dazu schon mal einen richtig langen anderen Thread … weil das bei mir einfach nicht laufen wollte.

Diverse Dinge fehlten auf dem Server die ich installieren musste, dann liefs ins falsche Verzeichnis und was weiß ich … hat nicht geklappt.
