-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to provide "require" keyword alternative? #1756
Comments
browserify/module-deps#141 will allow you to do this; once released, you can create a transform that finds |
As of browserify 16 you can write transforms for this: https://github.com/browserify/module-deps/#transforms module.exports = function () {
var data = ''
return through(ondata, onend)
function ondata (chunk, enc, cb) { data += chunk; cb() }
function onend (cb) {
var calls = findParaquireCalls(data)
for (var i = 0; i < calls.length; i++) {
this.emit('dep', calls[i])
}
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Greetings from Russia, comrads!
I'm working on paraquire - security-oriented alternative for standard
require
. It is supposed to be fully backward compatible, i.e. there could be bothrequire
andparaquire
calls in the same file. I prepared PR #1755 to show how willbrowserify
look withparaquire
.As main security risks are access to FS and access to network, paraquire in browserified environment should act as usual require. Unfortunately, this trick wasn't successful: browserify does not treat paraquired libraries as dependencies while parsing module.
Is there any existing option to tell
browserify
to parseparaquire
calls asrequire
calls? I only need dependency injecting, not function redefinition. I guess that dependency list is defined bydetective
package, but which exact options should I pass?The text was updated successfully, but these errors were encountered: