Closed Aaronius closed 8 years ago
@aaronius thanks will have a look ๐๐ผ
function inject(source) {
this.cacheable && this.cacheable();
return 'module.exports = ' + createInjectorFunction(this, source);
}
// Object.defineProperty(exports, "__esModule", {
// value: true
// });
// exports.default = inject;
module.exports = inject;
a bit of hit & miss as I don't understand webpack loader system that well but this fixed it for me
hi @plasticine, do you have plan to fix this bug?
@lvthanh101 Yep, just havenโt had time. Hopefully soon.
hey man, I guess you made a mistake on return value. like @oviava said
function inject(source) {
this.cacheable && this.cacheable();
return 'module.exports = ' + createInjectorFunction(this, source);
}
the return value should be a module, it should export some thing. so module.exports
here should not omit.
https://github.com/plasticine/inject-loader/blob/master/lib/index.js#L107 here's the problem
Please check out 3.0.0-beta3
which should fix this issue and also introduces support for webpack2.
When I try to upgrade from 2.x to 3.0.0-beta1 I start getting the following errors:
I'm guessing it has to do with the es6 modules in 3.x or something.