Copy task for Start.
npm install --save-dev start-copy
# or
yarn add --dev start-copy
import start from 'start';
import reporter from 'start-pretty-reporter';
import files from 'start-files';
import copy from 'start-copy';
export const build = () => start(reporter())(
files('src/**/*.png'),
copy('build/')
);
is functionally the same as:
import start from 'start';
import reporter from 'start-pretty-reporter';
import files from 'start-files';
import read from 'start-read';
import write from 'start-write';
export const build = () => start(reporter())(
files('src/**/*.png'),
read(),
write('build/')
);
but it uses Streams and should be the preferred way to copy files, especially for large and/or binary formats like images.
This task relies on array of files and provides the same, see documentation for details.
copy(dir)
dir
– output directory, will be created automatically if it doesn't exists