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

MrPaulDriver created an issue. See original summary.

kevinquillen’s picture

There 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.

  • Your committed aggregate CSS per gulp should have everything in the bower components
  • Your committed aggregate JS per gulp should also have everything in it that it needs

So then:

  • There is only a need to commit package.json in your theme, anyone can run and get the packages, and/or
  • You may have a build server like Jenkins fetch and compile assets and push them out

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.

MrPaulDriver’s picture

Title: To deploy node files on a production sites or not? » To deploy node files on production sites or not?
kevinquillen’s picture

Status: Active » Fixed

Closing. 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.

kevinquillen’s picture

MrPaulDriver’s picture

Sorry for not acknowledging your comments earlier Kevin. Thank you for the suggestions,

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.