-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
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
Add "iit" preprocessor and optimize file loading #1
Comments
I'm actively working towards this, hopefully making it slightly easier to setup and less "work" and hopefully solve an issue I ran into. (Where the require worked when running in browserify, but failed when running in this context) I find myself wondering about the API for Karma. Is it possible for the framework to return an asynchronous callback or a promise for it's initialization function? The approach I currently have is the config.preprocessor array would be filtered looking for 'commonjs' entries. var initCommonJS = function(preprocessors, files) {
_.filter(preprocessors, function filterCommonJS(frameworks, pattern) {
if (frameworks.indexOf('commonjs') >= 0) {
var matches = glob.sync(pattern);
async.each(matches, function(filePath, cb) {
resolver(filePath).then(function(deps) {
dependencies = _.union(dependencies, deps);
cb(null);
});
}, function() {
dependencies = _.unique(dependencies, 'filename');
_.each(dependencies, function(dependency) {
files.push({
pattern: dependency.filename,
included: true,
served: true,
watched: true
});
});
// Include the file that resolves all the dependencies on the client.
files.push({
pattern: BRIDGE_FILE_PATH,
included: true,
served: true,
watched: false
});
});
}
});
}
};
initCommonJS.$inject = ['config.preprocessors', 'config.files']; Dependencies Issues currently:
|
Similar to https://github.com/karma-runner/karma-closure parse source files (probably using https://github.com/shtylman/node-required to build a dependency tree and optimize file loading (load only required files):
The text was updated successfully, but these errors were encountered: