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

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

问题描述

我正在使用 webpack.

I'm using webpack.

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

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?

分叉自:如何部署使用 Gulp 的节点heroku

推荐答案

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

这更好,因为如果你使用 postinstall,每次你执行 npm i 构建脚本都会被触发

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

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

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