如何让package.json不在heroku应用的顶层 [英] How to have package.json not at top level of heroku app
问题描述
我有一个部署到heroku的应用程序:
I have this app that deploys to heroku:
https://github.com/justin808/react-webpack-rails-tutorial
http://react-webpack-rails-tutorial.herokuapp.com/
当前,package.json位于项目的根目录。
Currently, package.json is at the root level of the project.
如何将/package.json和/ node_modules移到/ webpack目录中?
How do move the /package.json and /node_modules to be inside of the /webpack directory?
即,如何告诉节点buildpack在哪里寻找软件包.json?
I.e., how do I tell the node buildpack where to look for package.json?
推荐答案
ix是在package.json中使用它:
The fix is to use this in package.json:
"scripts": {
"postinstall": "cd client && npm install",
您可以在此处查看完整详细信息: https://github.com/shakacode/react-webpack-rails-tutorial/blob/ master / package.json#L10
You can see the full details here: https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/package.json#L10
这篇关于如何让package.json不在heroku应用的顶层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!