如何将使用Webpack的节点部署到heroku [英] How to deploy node that uses Webpack to heroku

查看:95
本文介绍了如何将使用Webpack的节点部署到heroku的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用webpack。

另外,我不提交npm_modules文件夹和公用文件夹,其中所有生成的文件都是。我无法弄清楚如何在部署和设置我的服务器(它已经在寻找公共文件夹)之后构建我的应用程序(我有webpack build命令)。



它看起来我是一个坏主意,在上传前提交。也许有一些温和的决定......任何想法?



从以下分支:如何将使用Gulp的节点部署到heroku

解决方案

 heroku-postbuild:webpack -p --config ./webpack.prod.config.js --progress

这更好,因为如果你使用postinstall,每次你做 npm i 构建脚本被解雇

I'm using webpack.

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 webpack 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 that uses Gulp to heroku

解决方案

"heroku-postbuild": "webpack -p --config ./webpack.prod.config.js --progress"

this is better because if you use postinstall, everytime you do npm i the build script get fired

这篇关于如何将使用Webpack的节点部署到heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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