Skip to content

Commit

Permalink
* [doc] upgrade for weex-toolkit & add more how-to doc to Summary
Browse files Browse the repository at this point in the history
  • Loading branch information
lvscar committed Jun 23, 2016
1 parent b5ff2e4 commit cb26881
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
11 changes: 9 additions & 2 deletions doc/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@
* [Page Config & Data](/syntax/config-n-data.md)
* [How-tos](/how-to/main.md)
* [Require 3rd-party Libs](/how-to/require-3rd-party-libs.md)
* [Transform Code Into JS Bundle](/how-to/transform-code-into-js-bundle.md)
* [Preview In Browser](/how-to/preview-in-browser.md)
* [Preview In Browser](/how-to/preview-in-browser.md)
* [Preview in Native]/how-to/preview-in-playground-app.md)
* [Customize a native Component](/how-to/customize-a-native-component.md)
* [Customize native APIs](/how-to/cuszomize-native-apis.md)
* [Debug in html5 renderer](/how-to/debug-with-html5.md)
* [Require 3rd Party Libs](/how-to/require-3rd-party-libs.md)
* [Transform Code Into JS Bundle](/how-to/transform-code-into-js-bundle.md)

* [Advanced](/advanced/main.md)
* [How It Works](/advanced/how-it-works.md)
* [How Data Binding Works](/advanced/how-data-binding-works.md)
Expand All @@ -24,6 +30,7 @@
* [Extend to Android](/advanced/extend-to-android.md)
* [Extend to iOS](/advanced/extend-to-ios.md)
* [References](/references/main.md)

* [Bootstrap](/references/bootstrap.md)
* [Component Definition](/references/component-defs.md)
* [Instance APIs](/references/api.md)
Expand Down
28 changes: 26 additions & 2 deletions doc/how-to/transform-code-into-js-bundle.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,34 @@ Paragraphs [Maintain Your Component Code](./maintain-your-component-code.md), [M

Now come back to the topic `transform code into js bundle`. There are several ways to achieve the goal.

## weex-toolkit
```bash
$npm install -g weex-toolkit
```

### 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

please access [npmjs.com](https://www.npmjs.com/package/weex-toolkit) for more information about weex-toolkit.

## transformer

```bash
tnpm install weex-transformer
npm install weex-transformer
```

### CLI Tool
Expand Down Expand Up @@ -54,7 +78,7 @@ returns:
## gulp weex

```bash
tnpm install gulp-weex
npm install gulp-weex
```

```javascript
Expand Down
6 changes: 6 additions & 0 deletions doc/specs/js-bundle-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ As the sample above, the component name should be hyphenated (a-z, 0-9, "-"). Ot

And, the method call `bootstrap()` allows 1~3 parameters: root module name (String), config info (optional JSON) and external data (optional JSON).


## NOTICE
After Weex added multi-module support ( support using `require` in your `<script>` tag include other we file or js code into current we file). we begin using [Webpack](https://webpack.github.io/) as module bundler in our tool chain. So the eventual format of Weex JSBundle is webpack packed .

if you are JS Ninja, explore [weex-transformer](https://www.npmjs.com/package/weex-transformer) will give your unpacked , original Weex JS Bundle .

## Content of Composed Components

A module of composed component contains 3 parts: whole options definition, additional template option definition and additional style option definition.
Expand Down

0 comments on commit cb26881

Please sign in to comment.