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
$ npm --version
output less then 2.15.1
, please run below cmd upgrade your npm at first
sudo npm install -g npm
Install
$npm install -g weex-toolkit
Usage
$weex foo/bar/input_path [options]
$weex create file_name [options]
Options:
--qr display QR code for native runtime, **default action**
-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
--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)
--version show version of weex toolkit
--help Show help
Examples
crate a we file
(weex source file) using standard template
$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
$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.
$weex your_best_weex.we -o . --watch
transform every we file in a directory
$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
$weex your_best_weex.we --qr
a QR code will display in your terminal , using Playground App scan that.
start http server
$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