Gulp 我需要 /dist 有 node_modules 和 .git
Gulp I need /dist to have node_modules and .git
我有这样的文件夹结构
- 距离
- 来源
- public
- index.html
- main.js
- 服务器
- server.js
- package.json
- 过程文件
- .env
- .git忽略
- .git
- gulpfile.js
- node_modules
我需要将 /dist 上传到 Heroku,它需要 git。我在项目中也需要 node_modules 。顶部的 package.json 包括 express 和 socket.io 依赖项以及 gulp 作为 devDependencies。我应该将整个东西上传到 git 和 heroku 还是只在顶部的 package.json 中安装 devDependencies 并在 /src 中创建另一个 package.json and node_modules and git 然后移动它到/dist。我希望 /dist 能够自给自足。但是如何?
希望此解释对您有所帮助:
如果您有一个 npm 脚本将项目构建到 dist 文件夹,然后 npm 脚本 start 到 运行,/dist 文件夹将是自给自足的您的应用程序从此文件夹中。
另一件事,node_modules 和 dist 文件夹 shouldn't 转到任何存储库,因为它们是从 npm 脚本(npm install 和npm 运行 构建,按顺序)。
此外,如他们的文档中所述,package.json 的 "dependencies" 部分必须 包含构建应用程序所需的所有包
为什么会这样?
"After running the installation and build steps Heroku will strip out the packages declared under devDependencies before deploying the application." - Heroku 团队
如果您有任何其他问题,请在此处回复...
我有这样的文件夹结构
- 距离
- 来源
- public
- index.html
- main.js
- 服务器
- server.js
- public
- package.json
- 过程文件
- .env
- .git忽略
- .git
- gulpfile.js
- node_modules
我需要将 /dist 上传到 Heroku,它需要 git。我在项目中也需要 node_modules 。顶部的 package.json 包括 express 和 socket.io 依赖项以及 gulp 作为 devDependencies。我应该将整个东西上传到 git 和 heroku 还是只在顶部的 package.json 中安装 devDependencies 并在 /src 中创建另一个 package.json and node_modules and git 然后移动它到/dist。我希望 /dist 能够自给自足。但是如何?
希望此解释对您有所帮助:
如果您有一个 npm 脚本将项目构建到 dist 文件夹,然后 npm 脚本 start 到 运行,/dist 文件夹将是自给自足的您的应用程序从此文件夹中。
另一件事,node_modules 和 dist 文件夹 shouldn't 转到任何存储库,因为它们是从 npm 脚本(npm install 和npm 运行 构建,按顺序)。
此外,如他们的文档中所述,package.json 的 "dependencies" 部分必须 包含构建应用程序所需的所有包
为什么会这样?
"After running the installation and build steps Heroku will strip out the packages declared under devDependencies before deploying the application." - Heroku 团队
如果您有任何其他问题,请在此处回复...