Closed flipchart closed 9 years ago
I'm also seeing this one.
fs.createWriteStream
from Node.js core doesn't create directories. Create the directory before running your script, or use fs.mkdir
or the mkdirp
module.
var browserify = require("browserify");
var path = require('path');
var fs = require("fs");
var files = ["./Scripts/test/x.js", "./Scripts/test/y.js"];
var outputDirectory = "./wwwroot";
fs.mkdir(outputDirectory, function (err) {
if (err) {
throw err;
}
var b = browserify(files);
b.plugin("factor-bundle", {
outputs: ["output/x.js", "output/y.js"],
});
b.bundle().pipe(fs.createWriteStream(path.join(outputdir, "./common.js")));
});
If you specify a directory in the
output
parameter which doesn't exist, thenfactor-bundle
fails with the following message:Script being executed:
Input scripts as per homepage example.
Environment: Windows 8.1 x64 Node.js v0.10.33 Browserify 8.0.2 factor-bundle 2.3.3