Compiling Javascript Storefront Plugins with theme:compile?

Hi,

bin/console theme:compile doesn’t only compile the scss-File’s.

Is it possible to compile the Javascript-Plugin’s for the Storefront.

I’m using the production environment.

I know, that with the development envirornment i have to use ./psh.phar storefront:build

Thanks and best regards,

Werner.

 

I quote the documentation here:

For CSS and Javascript things are a bit different. CSS and SCSS is handled by a PHP SASS compiler.

JavaScript can’t be compiled by PHP so webpack is used for compilation. This also means that you have to ship your plugin with the JavaScript already build.

 

So no, that’s not possible, you have to precompile it with storefront:build

 

Regards

Hi,

okay, thank’s.

I know, that webpack is used for compilation.

I have asked the question poorly, sorry.
Does Shopware intend to make this possible also in the production environment or will it never work

and I absolutely have to use the develop environment?

Thanks,

Werner.

Hi Werner,

there’s no javascript PHP compiler supporting modules.
So no, you’ll have to use Webpack (development template) and it won’t change in the near future.

1 „Gefällt mir“

Hi,

okay, thanks.

Best regards,

Werner.

Hi,

well, I’m a little confused.
Actually bin/build-storefront.sh does work to compile my Javascript-Plugin, but the question is whether it is a coincidence that this works in the production environment or should it also work from the shopware side. In other words, this will always work in the future?

Best regards,

Werner.

https://github.com/shopware/production/blob/6.1/bin/build-storefront.sh

This script uses npm and nodejs - so if your production environment hast both installed, it will work. Normally you won’t finde nodejs or npm on production environments.

1 „Gefällt mir“

Hi,

yes i know, but good to know it’s supposed to work.

Thanks and best regards,

Werner.