justingordon
justingordon

Reputation: 12913

How to have package.json not at top level of heroku app

I have this app that deploys to heroku:

https://github.com/justin808/react-webpack-rails-tutorial

http://react-webpack-rails-tutorial.herokuapp.com/

The technique is described here: http://www.railsonmaui.com/blog/2014/10/02/integrating-webpack-and-the-es6-transpiler-into-an-existing-rails-project/

Currently, package.json is at the root level of the project.

How do move the /package.json and /node_modules to be inside of the /webpack directory?

I.e., how do I tell the node buildpack where to look for package.json?

Upvotes: 8

Views: 3134

Answers (1)

justingordon
justingordon

Reputation: 12913

The fix is to use this in package.json:

  "scripts": {
    "postinstall": "cd client && npm install",

You can see the full details here: https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/package.json#L10

Upvotes: 3

Related Questions