如何让package.json不在heroku应用程序的顶层

jus*_*don 6 heroku buildpack

我有这个部署到heroku的应用程序:

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

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

该技术在此处描述:http://www.railsonmaui.com/blog/2014/10/02/integrating-webpack-and-the-es6-transpiler-into-an-existing-rails-project/

目前,package.json位于项目的根级别.

如何将/package.json和/ node_modules移动到/ webpack目录中?

即,如何告诉节点buildpack在哪里查找package.json?

jus*_*don 3

修复方法是在 package.json 中使用它:

  "scripts": {
    "postinstall": "cd client && npm install",
Run Code Online (Sandbox Code Playgroud)

您可以在此处查看完整详细信息:https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/package.json#L10