-
Notifications
You must be signed in to change notification settings - Fork 31
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
Rollup #117
Comments
OK, I'm looking at this now. I'm getting this:
That error is thrown from L30 in
However, working around that by replacing Mocha doesn't call I hope this is useful. Here's a gist of the resulting bundle |
Well the solution is straightforward: export const ensureRequire =
// Is it webpack?
typeof __webpack_require__ !== 'undefined'
// yeah? So let's use it's internal require
? __webpack_require__ :
// no? Then 👉👉👉👉 let's hide this require from webpack 👈👈👈👈
eval('require'); It has a special logic around Like detect rollup/browserify and do what they need. Or detect that "this is not webpack", and don't do some silly movements.
Technically it would not cause a major version change - I could create a new entrypoint which will work that way, keeping the old behavior default. Try thisCould you please make |
It won't, because we'll run into |
|
(rollup replaces |
🤔 Mocha.unloadFile = function (file) {
delete commonjsRequire.cache[commonjsRequire.resolve(file)];
}; Sounds like I should expose "current" wipe method from https://github.com/theKashey/rewiremock/blob/master/src/wipeCache.js |
unloadFile is not run by browser tests |
In this case the problem has origin in Line 61 in ccacac9
Not sure what this branch is used in your case, but it is what loads node-libs-browser
|
OK, I've made some progress here. I discovered that Rollup doesn't really love the dynamic So, I've told Rollup to ignore
rewiremock seems to be calling |
Rollup doesn't seem to have the ability to handle dynamic modules as webpack does (afaict this is a design decision). I would imagine if we wanted a module "tree", rewiremock would need to implement it. 😦 |
I wonder if nollup could be helpful |
|
yes, I eliminated it entirely from the package, but then I get the HotModuleReloading err above |
Which is bound to the module relationship information, which is not quite exists in rollup as you've mentioned. And What's with HMR stuff in rollup? Could it save the day as well? |
The text was updated successfully, but these errors were encountered: