-
-
Save Raynos/2321202ce8df9919ef19 to your computer and use it in GitHub Desktop.
This file contains 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 bundle = browserify({ | |
debug: true | |
}) | |
, code = "var process = require.modules.__browserify_process();\n" + | |
"process.env.NODE_ENV = 'production'\n" + | |
"require.modules.__browserify_process = function () {\n" + | |
" return process\n" + | |
"}" | |
var target = path.join(__dirname, "dummy.js") | |
bundle.files[target] = { | |
target: target | |
, body: code | |
} | |
bundle.addEntry(path.join(__dirname, "other.js"), { | |
body: "require('" + target + "')" | |
}) | |
bundle.addEntry(input) | |
var text = bundle.bundle() | |
fs.writeFileSync(output, text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment