1.下載安裝node
$ git clone https://github.com/alibaba/weex.gitgit
//經過brew安裝nodegithub
$ brew install node npm
//經過node安裝 weex-toolkit
$ npm install -g weex-toolkit json
//安裝iOS包管理工具 cocoapods
$ sudo gem install cocoapods服務器
2.安裝控件啓動Demobabel
$ npm installweex
$ ./start工具
3.建立本身的項目ui
$ weex init //建立項目的文件
$ npm install //依賴安裝 package.json文件
$ npm run dev //項目編譯
$ npm run serve //啓動輕量服務器
$ npm install babel-core
4.打包命令
npm run build:browser
: build HTML5 renderer to dist/browser.js
.npm run build:native
: build JS framework for native renderer to dist/native.js
.npm run build:examples
: build all js bundles from examples/
to examples/build/
.npm run build:test
: build all js bundles from test/
to test/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 through http://localhost:12580/
.note: you must run npm run build
first to prepare all the built files.npm run clean:examples
: clean examples/build/
.npm run clean:test
: clean test/build/
.npm run clean
: clean both examples/build/
and test/build/
.npm run copy
: copy JS framework and examples into Android project.npm run lint
, npm run test
, npm run cover
and npm run ci
are something quality assurance.