Hay Leute,
In meinem Plugin wird die main.js nicht gebaut / berücksichtigt.
ich hab ein devenv / platform Setup. Shopware Version 6.4.
Ich folge diesen Guide befolgt (Shopware 6.4: Add custom javascript):
meine Ordner:
meine main.js:
// Import all necessary Storefront plugins
import ExamplePlugin from './example-plugin/example-plugin.plugin';
// Register your plugin via the existing PluginManager
const PluginManager = window.PluginManager;
PluginManager.register('ExamplePlugin', ExamplePlugin);
meine example-plugin.plugin.js:
import Plugin from 'src/plugin-system/plugin.class';
export default class ExamplePlugin extends Plugin {
    init() {
        console.log('init')
        window.addEventListener('scroll', this.onScroll.bind(this));
    }
    onScroll() {
        if ((window.innerHeight + window.pageYOffset) >= document.body.offsetHeight) {
            alert('Seems like there\'s nothing more to see here.');
        }
    }
}
Meine theme.json:
{
  "name": "DemoCreate",
  "author": "Shopware AG",
  "views": [
     "@Storefront",
     "@Plugins",
     "@DemoCreate"
  ],
  "style": [
    "app/storefront/src/scss/overrides.scss",
    "@Storefront",
    "app/storefront/src/scss/base.scss"
  ],
  "script": [
    "@Storefront",
    "app/storefront/dist/storefront/js/demo-create.js"
  ],
  "asset": [
    "@Storefront",
    "app/storefront/src/assets"
  ]
}
Der dist Ordner war schon da beim bin/console theme:create. Und auch die theme.json habe ich nicht angefasst.
Auf grund meines setups run ich den Befehl: „composer run build:js:storefront“ Die Console meldet:
Es wird kein dist Ordner und dist JS Dateien gebaut. Oder in diesem Fall besser gesagt: die vorhandene nicht überschrieben.

