Skip to content
Permalink
Browse files

New: pass outfile to transforms via _flags

Adds _flags to the options, which is browserify compatible
  • Loading branch information...
forivall authored and mysticatea committed Oct 20, 2017
1 parent 14a8920 commit 692b67bf129e3a70c00f6e1129b9c04e018cfb90
Showing with 3 additions and 2 deletions.
  1. +2 −1 bin/main.js
  2. +1 −1 lib/utils/copy-file.js
@@ -87,7 +87,8 @@ module.exports = function main(source, outDir, args) {
const createStream = ABS_OR_REL.test(item.name)
? require(resolvePath(item.name))
: require(resolveModule(item.name, { basedir: process.cwd() }))
return file => createStream(file, item.argv)
return (file, opts) =>
createStream(file, Object.assign({ _flags: opts }, item.argv))
})

// Merge commands and transforms as same as order of process.argv.
@@ -54,7 +54,7 @@ function copyFileContent(source, output, transforms) {
try {
transforms
.reduce((input, factory) => {
const t = factory(source)
const t = factory(source, { outfile: output })
t.on("error", cleanup)
streams.push(t)

0 comments on commit 692b67b

Please sign in to comment.
You can’t perform that action at this time.