pico-transforms

    1.0.0 • Public • Published

    pico-transforms

    A collection of small, but useful Browserify transforms

    npm install pico-transforms

    const browserify = require('browserify');
    const yamlify = require('pico-transforms/yamlify');
    const svgify = require('pico-transforms/svgify');
    
    const b = browserify('input.jsx')
    	.transform(yamlify)
    	.transform(svgify);
    
    b.bundle((err, buf)=>{
    	fs.writeFileSync('output.js', buff);
    });

    yamlify

    inspired by yamlify

    Allows you to require YAML files when using browserify to have then translated to JSON on the fly.

    svgify

    inspired by svg-reactify

    Allows you to require SVG files when using browserify to have them translated into React components on the fly.

    • Uses functional React components
    • Transpiles it using babel
    • Optimizes the SVG using svgo
    • Strips out any style tags that would cause react parsing issues (may lose coloring, fixed by exporting SVG with 'inline-styles' selected)
    • Can pass className and style as props

    Install

    npm i pico-transforms

    DownloadsWeekly Downloads

    3

    Version

    1.0.0

    License

    ISC

    Last publish

    Collaborators

    • stolksdorf