Closed rubennorte closed 9 years ago
Having the same issue. Any help much appreciated.
Likewise hitting the same issue
As a temporary workaround: I've discovered reverting to an old version fixes the issue.
package.json:
"factor-bundle": "~2.3.2"
another workaround - just install the watch
package globally and be able to watch anything and trigger anything from it (ie - watch "browserify -p [factor-bundle]" location/of/files
+1 Same error here. I'm using gulp + browserify + watchify + factor-bundle@2.4.0 I reverted, to 2.3.2 but it didn't like my setup - however it works with factor-bundle@2.3.3. @idolizesc thanks for the idea of reverting.
Same here. 2.3.3 works great with watchify.
2.4.0 works when the build is started anew, but after the bundles are rebuilt by watchify -- the same error appears.
Same problem here. Reverting to 2.3.3 works for me.
Same for me. Reverting to 2.3.3 works for me too.
2.3.3 worked for me as well. Thanks!
confirmed 2.4.1 still not working
Because watchify or factor-bundle that write to multiple files or write to the same file more than once, If output is a function that return a writable stream, will be done. my fork
function write (name) {
return concat(function (body) {
console.log('// ----- ' + name + ' -----');
console.log(body.toString());
});
}
function outputs(filename) {
return write(filename)
}
b.plugin(factor, { outputs: outputs});
b.bundle().pipe(write('common.js'))
@Aben exactly what I needed! Thanks!
I don't understand the example @Aben gave. What is filename
here?
The use-case @rubennorte gave has factor-bundle outputting two files (page-a.js
and page-b.js
) in addition to shared.js
. If the outputs
is set to a function that is called once and can only return one filename or writable stream, how can factor-bundle output to more than one file using this method?
In @Aben's example, outputs is a function that watchify will invoke once for each file in the entries
parameter passed to watchify. The function's job is to translate an output filename into a stream writing to that filename.
Each entry in entries
is transformed into an output stream via the function passed to outputs
, so you end up with one stream for each file (such as page-a or page-b).
I'm getting this error when using them together, both in Windows 7 and in Linux (Node v0.10) with their latest versiong (watchify 2.4.0 and factor-bundle 2.4.0):
The error started happening when the bundle files started to grow (~100KB, not that much), so maybe you didn't discovered the error testing it in small bundles.
Any clue? Thanks!