From 5e52efe41a11768dbd9a7b24e0979035bc0d5c05 Mon Sep 17 00:00:00 2001 From: Vishal Telangre Date: Thu, 30 Nov 2017 22:56:21 +0530 Subject: [PATCH] Add 'nodejs' buildback (Ref: https://github.com/rails/webpacker/issues/739) --- Procfile | 4 ++-- Procfile.dev | 2 ++ app.json | 7 ++++--- config/database.yml | 22 ---------------------- config/webpacker.yml | 14 ++++++++++++-- package.json | 6 +++--- 6 files changed, 23 insertions(+), 32 deletions(-) create mode 100644 Procfile.dev delete mode 100644 config/database.yml diff --git a/Procfile b/Procfile index a2e9c0e..5b4679a 100644 --- a/Procfile +++ b/Procfile @@ -1,2 +1,2 @@ -rails: rails server -p 3333 -webpack: ./bin/webpack-dev-server +release: bin/rails db:migrate +web: nohup ./bin/webpack-dev-server; bin/rails server -p 12345 -e $RAILS_ENV diff --git a/Procfile.dev b/Procfile.dev new file mode 100644 index 0000000..a2e9c0e --- /dev/null +++ b/Procfile.dev @@ -0,0 +1,2 @@ +rails: rails server -p 3333 +webpack: ./bin/webpack-dev-server diff --git a/app.json b/app.json index f806380..4037884 100644 --- a/app.json +++ b/app.json @@ -2,8 +2,7 @@ "name": "elmsanity", "description": "", "scripts": { - "postdeploy": "cp config/database.yml.postgresql config/database.yml; bundle exec rails db:create; bundle exec rails db:migrate; NODE_ENV=production bundle exec rails webpacker:compile" - }, +}, "env": { "SECRET_KEY_BASE": { "generator": "secret" @@ -14,11 +13,13 @@ "HEROKU": "true" }, "formation": { + "web": { "quantity": 1 } }, "addons": [ ], "buildpacks": [ - + { "url": "heroku/nodejs" }, + { "url": "heroku/ruby" } ] } diff --git a/config/database.yml b/config/database.yml deleted file mode 100644 index 29cc972..0000000 --- a/config/database.yml +++ /dev/null @@ -1,22 +0,0 @@ -development: - adapter: postgresql - database: elmsanity_development - host: localhost - pool: 5 - -staging: - adapter: postgresql - database: elmsanity_staging - pool: 5 - timeout: 5000 - -production: - adapter: postgresql - database: elmsanity_production - pool: 5 - timeout: 5000 - -test: - adapter: postgresql - database: elmsanity_test - pool: 5 diff --git a/config/webpacker.yml b/config/webpacker.yml index d1e5f05..47e4582 100644 --- a/config/webpacker.yml +++ b/config/webpacker.yml @@ -65,5 +65,15 @@ production: staging: <<: *default - compile: false - cache_manifest: true + compile: true + dev_server: + https: false + host: localhost + port: 3035 + public: localhost:3035 + hmr: false + # Inline should be set to true if using HMR + inline: true + overlay: true + disable_host_check: true + use_local_ip: false diff --git a/package.json b/package.json index bb06d8c..6b140f7 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,10 @@ "@rails/webpacker": "^3.0.2", "coffeescript": "1.12.7", "elm": "^0.18.0", - "elm-webpack-loader": "^4.4.0" + "elm-webpack-loader": "^4.4.0", + "webpack-dev-server": "^2.9.4" }, "devDependencies": { - "elm-hot-loader": "^0.5.4", - "webpack-dev-server": "^2.9.4" + "elm-hot-loader": "^0.5.4" } }