From 05f45d08ef815d601b61896e1f205d2c9bb65633 Mon Sep 17 00:00:00 2001 From: Cyril Rohr Date: Wed, 4 Mar 2015 18:15:32 +0000 Subject: [PATCH] Do not use npm-shrinkwrap.json when packaging npm dependencies. This avoids downloading a huge amount of things that are only needed in development. It will reduce the package size, and certainly improve the reliability of the packaging process (i.e. less ECONNREFUSED when downloading phantomjs and such). This commit also updates the NodeJS buildpack, and forces the use of the HTTP npm registry for better performance and reliability when packaging. --- .buildpacks | 2 +- packaging/.npmrc | 1 + packaging/setup | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 packaging/.npmrc diff --git a/.buildpacks b/.buildpacks index fecb9275b2f..2048e052a92 100644 --- a/.buildpacks +++ b/.buildpacks @@ -1,2 +1,2 @@ -https://github.com/heroku/heroku-buildpack-nodejs.git#v58 +https://github.com/heroku/heroku-buildpack-nodejs.git#v71 https://github.com/pkgr/heroku-buildpack-ruby.git#universal diff --git a/packaging/.npmrc b/packaging/.npmrc new file mode 100644 index 00000000000..69cce98870b --- /dev/null +++ b/packaging/.npmrc @@ -0,0 +1 @@ +registry = 'http://registry.npmjs.org/' diff --git a/packaging/setup b/packaging/setup index 9aa154d3821..6eafcb988b4 100755 --- a/packaging/setup +++ b/packaging/setup @@ -6,5 +6,10 @@ sed -i "s|config.serve_static_assets = false|config.serve_static_assets = true|" cp -f packaging/conf/000-establish-connection.rb config/initializers/ +# Specific npmrc used for packaging +cp -f packaging/.npmrc .npmrc +# Install dependencies from package.json +rm -f frontend/npm-shrinkwrap.json + # replace every occurrence of _APP_NAME_ with the corresponding application name we're packaging find packaging/ -type f -print0 | xargs -0 sed -i "s|_APP_NAME_|${APP_NAME}|"