How to avoid having to use "composer update" when changing CSS and JS files in my theme extension?

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
kdim95
Advanced
Posts: 208
Joined: 26 Aug 2022, 12:17

How to avoid having to use "composer update" when changing CSS and JS files in my theme extension?

Post by kdim95 » 23 Oct 2022, 20:57

Laravel framework version: 9.36.4
Aimeos Laravel version: * 2022.07.2
PHP Version: 8.1.9
Environment: Linux

I have created a theme extension and selected it.

Every time I change a CSS or JS file in...
vendor/aimeos-themes/mytheme/themes/client/html/mytheme/*.css

The changes don't reflect on the frontend without doing composer up

How can you temporarily avoid the entire process of having to execute composer up every time and use the theme files directly from the extension?

I can edit the files directly in...
public/vendor/shop/themes/mytheme

But I don't want to accidentally overwrite them with composer up at a later point.

User avatar
aimeos
Administrator
Posts: 7919
Joined: 01 Jan 1970, 00:00

Re: How to avoid having to use "composer update" when changing CSS and JS files in my theme extension?

Post by aimeos » 24 Oct 2022, 17:34

You can link the ./packages/<extname>/themes/ folder of your extension to ./public/vendor/shop/themes/<extname>/ directory.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

kdim95
Advanced
Posts: 208
Joined: 26 Aug 2022, 12:17

Re: How to avoid having to use "composer update" when changing CSS and JS files in my theme extension?

Post by kdim95 » 25 Oct 2022, 08:04

I'm sorry, how do you 'link' it :)

User avatar
aimeos
Administrator
Posts: 7919
Joined: 01 Jan 1970, 00:00

Re: How to avoid having to use "composer update" when changing CSS and JS files in my theme extension?

Post by aimeos » 25 Oct 2022, 08:12

Use the Linux command line utility "ln":
https://linuxize.com/post/how-to-create ... n-command/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

kdim95
Advanced
Posts: 208
Joined: 26 Aug 2022, 12:17

Re: How to avoid having to use "composer update" when changing CSS and JS files in my theme extension?

Post by kdim95 » 25 Oct 2022, 10:01

I tried the following links

ls - s ./packages/<extname>/themes ./public/vendor/shop/themes/<extname>
ln -s ./packages/<extname>/themes/client/html/<extname> ./public/vendor/shop/themes/<extname>


it keeps looking for the files in ./public/vendor/shop/themes/<extname>

kdim95
Advanced
Posts: 208
Joined: 26 Aug 2022, 12:17

Re: How to avoid having to use "composer update" when changing CSS and JS files in my theme extension?

Post by kdim95 » 25 Oct 2022, 10:20

I solved it by providing the full paths when linking:

Code: Select all

ln -s /var/www/vhosts/<domain>/httpdocs/packages/<extname>/themes/client/html/<extname> /var/www/vhosts/<domain>/httpdocs/public/vendor/shop/themes/<extname>
And for removal of the link, the command is:

Code: Select all

unlink /var/www/vhosts/<domain>/httpdocs/public/vendor/shop/themes/<extname>
Should be noted that before linking to .../public/vendor/shop/themes/<extname>, the directory had to be deleted.
It will not link properly if the public theme directory already exists.

For listing of symbolic links to the directory, the command is:

Code: Select all

ls -l /var/www/vhosts/<domain>/httpdocs/public/vendor/shop/themes/<extname>

User avatar
peter69
Posts: 95
Joined: 09 Jun 2022, 19:31

Re: How to avoid having to use "composer update" when changing CSS and JS files in my theme extension?

Post by peter69 » 25 Oct 2022, 19:28

You saved my life!!!

Thank you so much!!

Post Reply