Weex命令
Posted L先森
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Weex命令相关的知识,希望对你有一定的参考价值。
1.下载安装
$ git clone https://github.com/alibaba/weex.git
//通过brew安装node
$ brew install node
//通过node安装 weex-toolkit
$ npm install -g weex-toolkit
//安装ios包管理工具 cocoapods
$ sudo gem install cocoapods
2.安装控件启动Demo
$ npm install
$ ./start
3.创建自己的项目
$ weex init //创建项目的文件
$ npm install //依赖安装 package.json文件
$ npm run dev //项目编译
$ npm run serve //启动轻量服务器
$ npm install babel-core
4.打包命令
npm run build:browser
: build html5 renderer todist/browser.js
.npm run build:native
: build JS framework for native renderer todist/native.js
.npm run build:examples
: build all js bundles fromexamples/
toexamples/build/
.npm run build:test
: build all js bundles fromtest/
totest/build/
.npm run build
: build all above.npm run dev:browser
,npm run dev:native
,npm run dev:examples
,npm run dev:test
are the watcher mode for all build scripts, any file changes will automatically be built.npm run serve
: run a http server so you can access all examples in browser throughhttp://localhost:12580/
.note: you must runnpm run build
first to prepare all the built files.npm run clean:examples
: cleanexamples/build/
.npm run clean:test
: cleantest/build/
.npm run clean
: clean bothexamples/build/
andtest/build/
.npm run copy
: copy JS framework and examples into android project.npm run lint
,npm run test
,npm run cover
andnpm run ci
are something quality assurance.
以上是关于Weex命令的主要内容,如果未能解决你的问题,请参考以下文章