小程序开发--Taro 开发环境搭建

473 阅读1分钟

安装步骤

npm install -g @tarojs/cli (由于下载国外资源速度慢或者换成淘宝的cnpm)

yarn global add @tarojs/cli (个人推荐这种方式)

taro init XMan

cd XMan //进入XMan目录

yarn dev:h5

打开一个网页http://localhost:10086,并显示出Hello World,大功告成。

下面是生成文件目录的说明:

├── dist                   编译结果目录
├── config                 配置目录
|   ├── dev.js             开发时配置
|   ├── index.js           默认配置
|   └── prod.js            打包时配置
├── src                    源码目录
|   ├── pages              页面文件目录
|   |   ├── index          index 页面目录
|   |   |   ├── index.js   index 页面逻辑
|   |   |   └── index.css  index 页面样式
|   ├── app.css            项目总通用样式
|   └── app.js             项目入口文件
└── package.json