我有这个部署到heroku的应用程序:
https://github.com/justin808/react-webpack-rails-tutorial
http://react-webpack-rails-tutorial.herokuapp.com/
目前,package.json 位于项目的根级别。
如何将 /package.json 和 /node_modules 移动到 /webpack 目录中?
即,我如何告诉节点 buildpack 在哪里寻找 package.json?
我有这个部署到heroku的应用程序:
https://github.com/justin808/react-webpack-rails-tutorial
http://react-webpack-rails-tutorial.herokuapp.com/
目前,package.json 位于项目的根级别。
如何将 /package.json 和 /node_modules 移动到 /webpack 目录中?
即,我如何告诉节点 buildpack 在哪里寻找 package.json?
解决方法是在 package.json 中使用它:
"scripts": {
"postinstall": "cd client && npm install",
你可以在这里看到完整的细节:https ://github.com/shakacode/react-webpack-rails-tutorial/blob/master/package.json#L10