加载中...

1.7.1 CLI


Weex-Toolkit

Please access npmjs.com for latest version

Weex CLI tool set

Pre Install

some dependencies need recent version of npm to install

if your

  1. $ npm --version

output less then 2.15.1, please run below cmd upgrade your npm at first

  1. sudo npm install -g npm

Install

  1. $npm install -g weex-toolkit

Usage

  1. $weex foo/bar/input_path [options]
  2. $weex create file_name [options]
  3. Options:
  4. --qr display QR code for native runtime, **default action**
  5. -o,--output transform weex we file to JS Bundle, output path (single JS bundle file or dir)
  6. [for create sub cmd] it specified we file output path
  7. --watch using with -o , watch input path , auto run transform if change
  8. happen
  9. -s,--server start a http file server, weex .we file will be transforme to JS
  10. bundle on the server , specify local root path using the option
  11. --port http listening port number ,default is 8081
  12. --wsport websocket listening port number ,default is 8082
  13. -f, --force [for create sub cmd] force to replace exsisting file(s)
  14. --version show version of weex toolkit
  15. --help Show help

Examples

crate a we file(weex source file) using standard template

  1. $weex create hello-world-weex

a file named 'hello-world-weex.we' we be created in current directory

transform a we file to JS Bundle

  1. $weex your_best_weex.we -o .

your_best_weex.we will be transform to JS Bundle file your_best_weex.js , saved in your current directory

transform a we file to JS Bundle , watch this file ,auto run transformer if change happen.

  1. $weex your_best_weex.we -o . --watch

transform every we file in a directory

  1. $weex we/file/storage/path -o outputpath

every we file in we/file/storage/path we be transform to JS Bundle , saved in outputpath path

preview your we file using Weex Playground App

download & install weex playground App

  1. $weex your_best_weex.we --qr

a QR code will display in your terminal , using Playground App scan that.

start http server

  1. $weex -s .

a http server will start running , your current directory(.) will be the document root for the server , every weex .we file will be transforme to JS Bundle when access through the server

Issue & Feedback

Github Issue List


还没有评论.