Skip to content

Conversation

@Jelle-S
Copy link
Contributor

@Jelle-S Jelle-S commented Aug 8, 2024

After the build process is done, we have no more need for the source folder. Deleting it saves us around 150MB on the server where it is deployed, for each release we do.

After the build process is done, we have no more need for the source folder.
Deleting it saves us around 150MB on the server where it is deployed, for
each release we do.
@Jelle-S Jelle-S requested a review from lennartvava August 8, 2024 09:51
./node_modules/.bin/gulp build;

echo "Removing gent_base 'source' directory...";
rm -rf ../source;
Copy link
Collaborator

@lennartvava lennartvava Dec 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lokaal blijft het handig om de source niet te verwijderen tijdens het install script, ook bij bijv. een git checkout versie van het thema waarbij het install script gerund wordt, dan heb je uiteraard de source zeker nodig om aanpassingen te maken. Is het misschien een idee om een install-prod.sh te maken waarbij install.sh ingeladen wordt + extra commands zoals in deze commit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dat is een idee, maar dan moeten we op één of andere manier zeker zijn dat die install-prod.sh telkens bij composer install wordt uitgevoerd wanneer deze op onze deploy server wordt uitgevoerd, want momenteel wordt deze install.sh als post-install-script van composer uitgevoerd overal waar gent_base wordt gebruikt. Als we dat aanpassen loopt dat script ook nog steeds bij jullie lokaal...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jelle-S Is het mss mogelijk om die source folder uit te sluiten van een build, bv. via .npmignore (voor NPM builds) of in de CI/CD excluden?

@SvenVdv SvenVdv marked this pull request as draft February 27, 2025 09:29
@zero2one
Copy link
Collaborator

zero2one commented Jan 26, 2026

@Jelle-S & @lennartvava : You could use the COMPOSER_DEV_MODE variable to check if the install was performed with or without the dev packages (by default with).

  • with: do not delete the source directory (composer install)
  • without : delete the source directory (composer install --no-dev or COMPOSER_NO_DEV=1 composer install).

See https://getcomposer.org/doc/articles/scripts.md#defining-scripts

Note: During a Composer install or update command run, a variable named COMPOSER_DEV_MODE will be added to the environment. If the command was run with the --no-dev flag, this variable will be set to 0, otherwise it will be set to 1. The variable is also available while dump-autoload runs, and it will be set to the same as the last install or update was run in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants