如何将使用Gulp的节点部署到heroku [英] How to deploy node that uses Gulp to heroku
问题描述
我正在使用gulp和gulp插件,比如gulp-minify-css,gulp-uglify等(我的应用程序被列为npm依赖项)。
另外我不提交npm_modules文件夹和公用文件夹,其中所有生成的文件都是。我无法弄清楚如何在部署和设置我的服务器(它已经在查找公共文件夹)之后构建我的应用程序(我有gulp build命令)。
它看起来我是一个坏主意,在上传前提交。也许有一些温和的决定......任何想法?
>scripts:{
start:node app,
postinstall:gulp default
}
我不需要使用buildpack或配置。这似乎是最简单的方法。 我写过关于我使用的过程这里 I'm using gulp and also gulp plugins like gulp-minify-css, gulp-uglify etc (that listed as npm dependencies for my application). Also I don't commit npm_modules folder and public folder, where all generated files are. And I can't figure out how to build my app (I have gulp build command) after deploy and setup my server (it's already looking for public folder). It seems me a bad idea to commit before upload. Maybe there are some gentle decisions... Any thoughts? Forked from: How to deploy node app that uses grunt to heroku I was able to get this to work by adding this into my "package.json" file: The I didn't need to do anything else with buildpacks or configuration. This seems like the simplest way to do it. I wrote about the process I used here 这篇关于如何将使用Gulp的节点部署到heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
"scripts": {
"start": "node app",
"postinstall": "gulp default"
}
postinstall
script is run after the build pack. Check this for more information. The only annoying thing is that all of your dependencies have to live under "dependencies" instead of having separate "devDependencies"