[英]ionic 2 for browser platform is not working
I want to create an app which is able to run in mobile phone and also in browser (of course no device dependency functions). 我想创建一个能够在手机和浏览器中运行的应用程序(当然没有设备依赖功能)。 Here are the steps: 步骤如下:
ionic start --v2 demo blank 离子开始--v2演示空白
cd demo 光盘演示
ionic platform add browser 离子平台添加浏览器
ionic build browser 离子构建浏览器
cd platforms/browser cd平台/浏览器
php -S localhost:8000 的PHP -S本地主机:8000
Then open localhost:8000 in browser. 然后在浏览器中打开localhost:8000。
I looked through the ionicframework document. 我浏览了ionicframework文档。 There is nothing about platform browser . 与平台浏览器无关。 Can anybody advise how I can run my app in browser? 有人可以建议我如何在浏览器中运行我的应用程序吗? Thanks. 谢谢。
如果要运行浏览器平台,请使用cd platforms/browser/www
而不是cd platforms/browser
,然后从那里运行本地服务器。
Perform the following code at the root of the project and then the web-browser based version will be generated at /www/
folder including the sub-directories such as assets
, build
& index.html
which is the main point of entry for the web app. 在项目的根目录执行以下代码,然后将在/www/
文件夹中生成基于Web浏览器的版本,其中包括子目录(例如assets
, build
& index.html
,这是Web的主要入口点应用程式。
If you wanna have the app packaged as a staging or production bundle, the following command can be used, which will again generate the prod build at the same /www/
location. 如果您想将应用程序打包为临时产品包或生产包,则可以使用以下命令,该命令将再次在相同的/www/
位置生成prod版本。
npm run ionic:build --prod
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.