我们应该将package.json,bower.json,gulpfile.js推送到生产服务器

ims*_*eth 5 gitignore npm angularjs bower gulp

我使用gulp,bower,stylusangularjs应用程序.

我没有使用任何Continuous Integration技术,git pull从回购荷兰国际集团代码时手动git push都是为了master分支上bitbucket,考虑到这样的场景:

  1. 它是一个很好的做法,包括bower.json,package.jsongulpfile.js在生产服务器上,并通过手动安装依赖npm installbower install服务器上?
  2. 包含gulpfile.js在服务器上是否安全?

此外,如果使用任何Continuous Integration技术,最佳做法是什么?

我的.gitignore文件如下:

node_modules
dist
.tmp
.sass-cache
bower_components
private.xml
nbproject
gruntfile.js
gulpfile.js
package.json
Run Code Online (Sandbox Code Playgroud)

bin*_*dMe 5

添加package.json和bower.json文件以跟踪生产服务器上使用的依赖项.但是,您应该跳过上传gulp或grunt文件,因为它们仅供本地使用.它们不需要上传到生产服务器上.

编辑:如果您使用grunt/gulp重新启动节点服务器,例如使用grunt/gulp中的nodemon,您可以上传grunt/gulp文件.最后,如果您正确构建了节点服务器,那么将grunt/gulp文件放在服务器上是没有害的,因为这些文件会在服务器启动之前与您的系统进行交互.