首页 > 其他 > 详细

weex-toolkit打包

时间:2016-07-02 17:19:10      阅读:235      评论:0      收藏:0      [点我收藏+]

需要2.15.1及以上的npm支持

运行终端,查看版本

npm --version

如果版本低于2.15.1,需要更新

sudo npm install -g npm

安装weex-toolkit

npm install -g weex-toolkit

weex命令使用方法

weex foo/bar/we_file_or_dir_path  [options]
weex init
 
Options:
  --qr     display QR code for native runtime, 
  -o,--output  transform weex we file to JS Bundle, output path (single JS bundle file or dir)
           [for create sub cmd] it specified we file output path                    
  --watch  using with -o , watch input path , auto run transform if change
           happen
  -s,--server  start a http file server, weex .we file will be transforme to JS bundle on the server , specify local root path using the option
  -h, --host  specify server listening  IP 
  --port   http listening port number ,default is 8081            
  --wsport websocket listening port number ,default is 8082
  -f, --force   [for create sub cmd] force to replace exsisting file(s)
  --np     do not open preview browser automatic        
  --version show version of weex toolkit 
  --help   Show help  

示例

1.预览.we文件内容

weex your_best_weex.we

2.转换单个js包

weex your_best_weex.we -o .

3.转换.we目录为.js目录

weex we/file/storage/path -o outputpath

4.在官方示例中看自己的测试

weex your_best_weex.we --qr

5.启动本地服务

weex -s .

 

weex-toolkit打包

原文:http://www.cnblogs.com/Jsonlu/p/5635663.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!