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

♀尐吖头ヾ 提交于 2020-01-14 08:55:09

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/27519313/how-to-have-package-json-not-at-top-level-of-heroku-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!