如何将react-native-web的app项目部署到服务器端?

时间:2016-12-06 08:11:02

标签: react-native

我对react-native-web很新,

我只关注enter link description here并成功构建了一个开发版的网络应用

enter image description here

但我不确定如何将这些代码部署到我的服务器上,因为我正在使用共享托管服务器服务,所以我无法为我的项目安装组件,有没有办法构建bundle.js本地,我可以将js文件上传到服务器端?

任何人都可以帮助我吗?

问@ github:enter link description here

2 个答案:

答案 0 :(得分:1)

如何部署?以同样的方式但进入服务器。 我的意思是,将项目复制到服务器中,在控制台 ./ node_modules / .bin / webpack-dev-server --inline 中执行,现在您可以在{{{}查看运行到其他服务器的应用程序3}}

你必须更换" localhost"使用" nameOfYourServer"从外面进入。

当然,您必须安装所有内容(npm install),因为您已在本地安装。

答案 1 :(得分:0)

好的,我按照https://github.com/kauffecup/react-native-web-hello-world

中的步骤操作

我可以通过web-bundle commend创建一个bundle.js,可以在静态文件服务器上使用。