Giter VIP home page Giter VIP logo

Comments (8)

djskinner avatar djskinner commented on July 29, 2024 2

This may be useful for Webpack users looking for proxyquire-like functionality: https://github.com/plasticine/inject-loader

from proxyquire.

holyjak avatar holyjak commented on July 29, 2024

I see that rewire runs on Node but also supports webpack so may be that is a reasonable option? (Though I prefer proxyquire's API)

from proxyquire.

thlorenz avatar thlorenz commented on July 29, 2024

Have a look at proxyqurieify and proxyquire-universal.
They work with browserify via plugin or transform.
Not sure if webpack supports that.

FWIW all this is explained in the second paragraph of the README

from proxyquire.

bendrucker avatar bendrucker commented on July 29, 2024

No plans to support Webpack specifically since neither of us use it. If someone really wanted to invest the time I'd be willing to help offer guidance. Otherwise it's just not very high on my list.

I'd really recommend not using rewire. Using eval to write unit tests is a really bad idea in principle, but it can also create a ton of compatibility headaches as well. Most transpilers (e.g. Babel) can change your variable names and then everything breaks.

from proxyquire.

holyjak avatar holyjak commented on July 29, 2024

Thank you. I have looked briefly at the code of proxyqurieify, proxyquire-universal, and rewire-webpack and it seems to be no simple matter to port proxyquire to a new build tool so I guess I will need to use rewire :-(

from proxyquire.

thlorenz avatar thlorenz commented on July 29, 2024

Actually this is a good reason to switch to browserify.
We are opinionated obviously, but it's modular plugable nature makes packages like proxyquireify possible.
Or you stick with webpack until you run into the next nice thing you can't have ;)

from proxyquire.

jedrichards avatar jedrichards commented on July 29, 2024

Just noticed a new Babel plugin inspired by rewire. Thought it might be of interest: https://github.com/speedskater/babel-plugin-rewire

from proxyquire.

volkanunsal avatar volkanunsal commented on July 29, 2024

I'm coming here after trying the babel-plugin-rewire plugin. It doesn't support function imports. I had high hopes for this library, but I can't use it without Webpack support.

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.