Earlier versions of angular oclazyload had an option to configure asyncLoader to use webpack bundle loader as its script loader.
app.config(['$ocLazyLoadProvider', function ($ocLazyLoadProvider) {
$ocLazyLoadProvider.config({
asyncLoader: function (expr, callback) {
var load = require('bundle?lazy!oclazyDir/out/' + expr + '.js');
load(function (file) {
callback(null, file);
});
}
});
}
]);
How to achieve the same with the latest version of angular oclazyload. Replacing asyncLoader
with jsLoader
also didn't work out.