如何让package.json不在heroku应用的顶层 [英] How to have package.json not at top level of heroku app

查看:122
本文介绍了如何让package.json不在heroku应用的顶层的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have this app that deploys to 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位于项目的根目录。

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆