ray-build
ray build for compile react&react-native
Last updated 16 days 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

v2.0.0 之前版本,babel 采用的是 babel@6.x 版本

v2.0.0 -> babel@7

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

$ ray-build example
  > build example 将 example 目录下的文件,打包至 docsite。 支持 `js/jsx、assets、md/mdx、css/scss`

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

changelog

2020-5-21 v2.0.0

update babel@7.x

2020-5-9 v1.1.1

babel config add babel-plugin-transform-runtime

Current Tags

  • 2.0.0                                ...           latest (16 days ago)

11 Versions

  • 2.0.0                                ...           16 days ago
  • 1.1.1                                ...           a month ago
  • 1.1.0                                ...           a month ago
  • 1.0.19                                ...           a year ago
  • 1.0.18                                ...           a year ago
  • 1.0.16                                ...           a year ago
  • 1.0.15                                ...           a year ago
  • 1.0.14                                ...           a year ago
  • 1.0.13                                ...           a year ago
  • 1.0.12                                ...           a year ago
  • 1.0.11                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 38
Dependencies (12)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |