We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
A module like this will return {}
define(function(require, exports, module){ var logic = { a: 3 } return logic; });
Here is the index.js
var myRequire2 = require('enhanced-require')(module); console.log(myRequire2('./test'))
This will output {} instead of {logic: 3}. Why is this happening and how to fix it?
{}
{logic: 3}
I can't change all the define(function(require, exports, module){ files to make them work with module.exports = logic. (The module.exports works ok)
define(function(require, exports, module){
module.exports = logic
On the client side with webpack works perfectly fine.
Thanks
The text was updated successfully, but these errors were encountered:
Here https://github.com/webpack/enhanced-require/blob/master/lib/RequireContext.js#L344 instead of:
fn(reqFn, parent.exports, parent);
should be
parent.exports = fn(reqFn, parent.exports, parent);
Or something more specific, like only replacing if no value is set in parent.exports.
Sorry, something went wrong.
Fix webpack#6 Now you can also return value from define function like…
653988b
… can be done with require.js
Added tests issue webpack#6
819fe70
No branches or pull requests
A module like this will return {}
Here is the index.js
This will output
{}
instead of{logic: 3}
. Why is this happening and how to fix it?I can't change all the
define(function(require, exports, module){
files to make them work withmodule.exports = logic
. (The module.exports works ok)On the client side with webpack works perfectly fine.
Thanks
The text was updated successfully, but these errors were encountered: