Created
March 9, 2016 20:22
-
-
Save geloescht/3882d5aa99b75cc211d4 to your computer and use it in GitHub Desktop.
Browserify require fails to expose to relative paths
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var virtual = require('../virtual'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var browserify = require('browserify'); | |
var File = require('vinyl'); | |
var path = require('path'); | |
var vFile = new File({ | |
contents: new Buffer('module.exports = ' + JSON.stringify({ foo: 'NARF!' }) + ';'), | |
path: 'virtual', | |
base: __dirname | |
}); | |
try | |
{ | |
browserify('browserify-test/test', { basedir: __dirname }) | |
.exclude('virtual') | |
.require(vFile, { expose: 'virtual', basedir: './' }) | |
.bundle() | |
.pipe(process.stdout); | |
} | |
catch(e) | |
{ | |
console.log("Error: ", e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment