Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
What advice can be given about whether or not to include bower dependencies and node files on a production site?
It seems that many of these items are not needed in production and just take up space.
What are recommendations for good practice?
Comments
Comment #2
kevinquillen CreditAttribution: kevinquillen at Velir commentedThere are two approaches. Neither involve committing node modules or bower components because it adds a lot of useless overhead in the git history and isn't necessary.
So then:
If your live server(s) recompile CSS with extra jobs, I would advise installing bower/npm there and running the appropriate commands when you need them.
Comment #3
MrPaulDriver CreditAttribution: MrPaulDriver commentedComment #4
kevinquillen CreditAttribution: kevinquillen at Velir commentedClosing. In summation.. do not commit node/bower files. Best practice is to have build tasks build/bundle assets up via Gulp into as few files as needed (css/js) and commit that into the project.
Comment #5
kevinquillen CreditAttribution: kevinquillen at Velir commentedComment #6
MrPaulDriver CreditAttribution: MrPaulDriver commentedSorry for not acknowledging your comments earlier Kevin. Thank you for the suggestions,