Giter VIP home page Giter VIP logo

Comments (5)

thlorenz avatar thlorenz commented on July 29, 2024

Not sure how that would work, since I'm rewriting the module to be resolved (the one that has its dependencies stubbed via modified require) to another file: https://github.com/thlorenz/proxyquire/blob/master/proxyquire.js#L244.

I do this in order to hook in the require override.
Do you have an idea how that could work with browserify? As far as I can tell fs module isn't available client side.
Vm is however. Is there possibly another way to hook proxyquire in (ie. without rewriting the source, but by running modified code manually in the VM)?

Don't have much experience in that area, so maybe you could give some pointers. Thanks.

@substack, do you have an idea how to mock the require in browserify?

from proxyquire.

Raynos avatar Raynos commented on July 29, 2024

@thlorenz https://github.com/Raynos/examplifier/blob/master/assets/index.js#L132

In browserify you can do anything. Just do a require.define(tempName call and then have proxyquire require those temp names.

from proxyquire.

thlorenz avatar thlorenz commented on July 29, 2024

Cool, thanks that looks fairly straight forward. I'll dig into it.

from proxyquire.

thlorenz avatar thlorenz commented on July 29, 2024

Glad to let you know that this is in the works.

from proxyquire.

thlorenz avatar thlorenz commented on July 29, 2024

Now proxyquireify does exactly what you asked for, i.e. it does what proxyquire does, but works with browserify.

from proxyquire.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.