Write task for Start.
npm install --save-dev start-write
# or
yarn add --dev start-write
import start from 'start';
import reporter from 'start-pretty-reporter';
import files from 'start-files';
import clean from 'start-clean';
import babel from 'start-babel';
import write from 'start-write';
export const build= () => start(reporter())(
files('build/'),
clean(),
files('lib/**/*.js'),
babel({ sourceMaps: true }),
write('build/')
);
This task relies on [{ path, data, map }]
input and provides the same, see documentation for details.
write(dir, encoding, sourcemapOptions)
dir
– output directory, will be created automatically if it doesn't existsencoding
–fs.writeFile
encoding option,utf-8
by defaultsourcemapOptions
– options using to generate Source Maps:extname
– sourcemap file extension,'.map'
by defaultprefix
– prefix string which will be used to generatesourceMappingURL
sourcemap comment,''
by default