Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
lib/ | 12-May-2024 | - | 310 | 259 | ||
test/ | 12-May-2024 | - | 227 | 197 | ||
.gitignore | D | 12-May-2024 | 32 | 4 | 3 | |
.jscsrc | D | 12-May-2024 | 666 | 32 | 27 | |
LICENSE | D | 12-May-2024 | 1 KiB | 22 | 17 | |
NOTICE | D | 12-May-2024 | 258 | 8 | 5 | |
README.md | D | 12-May-2024 | 1 KiB | 22 | 16 | |
circle.yml | D | 12-May-2024 | 36 | 4 | 3 | |
gulpfile.js | D | 12-May-2024 | 497 | 26 | 20 | |
index.js | D | 12-May-2024 | 317 | 9 | 7 | |
package.json | D | 12-May-2024 | 866 | 36 | 35 |
README.md
1# Weex `<script>` Transformer 2 3[![NPM version][npm-image]][npm-url] 4[![Build status][circle-image]][circle-url] 5[![Downloads][downloads-image]][downloads-url] 6 7[npm-image]: https://img.shields.io/npm/v/weex-scripter.svg?style=flat-square 8[npm-url]: https://npmjs.org/package/weex-scripter 9[circle-image]: https://circleci.com/gh/weexteam/weex-scripter.svg?style=svg 10[circle-url]: https://circleci.com/gh/weexteam/weex-scripter/tree/master 11[downloads-image]: https://img.shields.io/npm/dm/weex-scripter.svg?style=flat-square 12[downloads-url]: https://npmjs.org/package/weex-scripter 13 14transform JavaScript 15 16## API 17 18- `fix(code)`: automatically add `data: {function () {return {...}}}` to init component data from `data: {...}` 19- `parseAndReplaceRequire(code)`: parse third party js required in `<script>`, return the modified code and collect requires 20 * note that `require` is automatically changed to `browserifyRequire` because of the built-in `require` in `js-framework` 21- `getBundle(requires)`: bundle all the third party js required in `<script>` by using `browserify` 22