Skip to content

How to do some assets modification? #6

@lifeart

Description

@lifeart

For example:

  • How to create 2-4 copy of .jpg with differend quality and rename it from sun.jpg -> sun_low.jpg, sun_mid.jpg, sun_hi.jpg, sun_retina.jpg
  • convert all .png into .webp?
  • create list of chanks for audiofile and put each chung in dist subfolder? {1.mp3, 2.mp3 -> /1/file.mp3, /2/file.mp3}

How it may looks like in broccoli tree paradigm?
for example, I have external js plugins, and they accept binary data and return binary.

1.)

import imgScaler from 'some-repo';
let scaledResult =  await imgScaler(rawInput, { sceleQuality: 25 });

2.)

import imgConverter from 'some-repo';
let convertedImg =  await imgConverter(rawJPGInput, { output: 'webp' });

3.)

import musicSlicer from  'some-repo';
let slices =  await musicSlicer(rawMp3FileInput, { slices: 42 });

How to extract binary from tree?
How to "replace" one binary to another?
How to dynamically add binary into tree?
How to rename tree item?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions