ray-build
ray build for compile react&react-native
Last updated 5 months ago by ilex.h .
MIT · Original npm · Tarball · package.json
$ cnpm install ray-build 
SYNC missed versions from official npm registry.

ray-build

v1.0.11 及之前版本 -> gulp@3

v1.0.12 -> gulp@4

author

ilex.h

descr


特性

安装

npm i ray-build --save--dev

使用

ray-build [options]

命令行参数

$ ray-build -h

  Usage: ray-build [options]

  Options:

    -h, --help                output usage information
    -v, --version             output the version number

支持的task

$ ray-build react
 > build react components

$ ray-build scss
  > build scss

$ ray-build less
  > build less

$ ray-build stylescss
  > build stylescss, 将 style或styles下的scss 文件,打包至 lib下,如果存在 `/style[s]/index.scss`,则编译为 `/style[s]/index.css`

$ ray-build styleless
  > build styleless,将 style或styles下的less 文件,打包至 lib下,如果存在 `/style[s]/index.less`,则编译为 `/style[s]/index.css`

$ ray-build pluginEntry
  > build pluginEntry

$ ray-build plugin
  > build plugin =>

    index.js -> index.plugin.js
    customRoutes.js -> customRoutes.plugin.js
    extraEntry.js -> extraEntry.plugin.js
    reducer.js -> reducer.plugin.js
    src -> lib

svgtoolkit

1.0.14 之后支持

use dir

svgtoolkit mysvg

use files

svgtoolkit mysvg/a.svg mysvg/b.svg

输出结果比较:

a.svg

<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 640 480"
aria-label="svg area demo"
>
  <path id="p1" name="path 1" fill="#FF0000" d="M499,72 L606,84 L531,186 L458,136 L499,72 z" ></path>
</svg>

a.js

export default {
  label: 'svg area demo',
  viewBox: '0 0 640 480',
  children: [
    { name: 'path 1', id: 'p1', path: 'M499,72 L606,84 L531,186 L458,136 L499,72 z' }
  ]
};

since 1.0.17 之后,新增解析 groups、texts

该版本之后,将新增节点 groups、texts。同时将 'line', 'polyline', 'polygon', 'rect', 'circle', 'ellipse' 转化为 path

结果:

export default {
  label: 'svg area demo',
  viewBox: '0 0 640 480',
  children: [
    { name: 'path 1', id: 'p1', path: 'M499,72 L606,84 L531,186 L458,136 L499,72 z' }
  ],
  groups: [], // group 仅支持 g 节点嵌套一层
  texts: []
};

数据中,如果没有设置 id 字段,则自动会填充 key 字段。 在react 应用中,可以合理使用 idkey

License

MIT

Current Tags

  • 1.0.19                                ...           latest (5 months ago)

8 Versions

  • 1.0.19                                ...           5 months ago
  • 1.0.18                                ...           5 months ago
  • 1.0.16                                ...           6 months ago
  • 1.0.15                                ...           6 months ago
  • 1.0.14                                ...           6 months ago
  • 1.0.13                                ...           9 months ago
  • 1.0.12                                ...           10 months ago
  • 1.0.11                                ...           10 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 4
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |