hughsk / fresh-require Goto Github PK
View Code? Open in Web Editor NEWBypass the require cache when requiring a module – works with both node and browserify
License: Other
Bypass the require cache when requiring a module – works with both node and browserify
License: Other
Given this:
var fresh = require('fresh-require')
var async1 = require('async')
var async2 = fresh('async', require)
What should be the expected behaviour of:
console.log(async1 === async2)
#Hi this is a great idea but Im struggling to get this to work with the latest browserify.What version of browserify is v1.0.3 compatible with. I have tried browserify v6.2.0 as listed in package.json, but still having problems.
Hi!
I want to use your module to test Flux stores (React). I need to reload stores on every test so your module would be helpful. I'm trying to make it work with karma and browserify but I get an error:
Uncaught TypeError: Cannot read property 'arguments' of null
The script fails on this line:
var $0 = arguments.length === 3 ? arguments.callee.caller : arguments.callee.caller.caller, $1 = (arguments.length === 3 ? arguments.callee.caller : arguments.callee.caller.caller).arguments[0];
My karma settings:
browserify: {
debug: true,
transform: [['fresh-require/transform']],
extensions: ['.js', '.json', '.es6']
},
The script I use:
var fresh = require('fresh-require')
var async1 = require('async')
var async2 = fresh('async', require)
console.log('async1 === async2', async1 === async2);
I also tried to transform it on command line with browserify -t fresh-require/transform -o bundle.js ./test.js
but got another error:
Uncaught TypeError: Cannot read property '1' of undefined
The error happens here
Am I missing something?
Thanks!
I'd like to use this module but we can't use any module that doesn't have passing CI. Can you add travis?
When I try to run the created bundle js I'm getting the following error:
TypeError: 'undefined' is not an object (evaluating 'sources[name][1]')
It seems that sources[names]
is undefined. It looks like that your bugfix doesn't solved the problem.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.