Closed cabloo closed 7 years ago
To clarify: If the order is
IoC.use(IoC.node_modules());
IoC.use(IoC.dir('./'));
Then this PR isn't needed, correct?
Well, that's more of a workaround. I personally would not use this feature, but it could be used if components of your application were distributed and included via npm. IoC.create('my-custom-npm-package')
would then do dependency injection as expected if my-custom-npm-package
's index.js
had
exports['@literal'] = false;
whereas currently, this value is overridden.
Will this feature be any use? If so I could fix up the broken tests and write another test showing that it works.
My application uses
require('app/...')
so thenode_modules
source works for injection of my files. However, when the files get injected they are (surprisingly) the original function with no dependencies injected. Some digging revealed that@literal
was the cause of this, and I was surprised when I could not turn it off usingexports['@literal'] = false;
inside my file. This allows that functionality.For others having this issue, it also turned out that changing
to
fixed the issue for me. I would expect the priority to be on the first items, but I guess it makes more sense the other way around.