single entrypoint for Webpack

This commit is contained in:
alecmerdler 2017-01-19 14:54:00 -08:00
parent 5058318454
commit 8f0f16a551
7 changed files with 62 additions and 52 deletions

View file

@ -0,0 +1,28 @@
export default {
'_pages': {},
'create': function (pageName, templateName, opt_controller, opt_flags, opt_profiles) {
var profiles = opt_profiles || ['old-layout', 'layout'];
for (var i = 0; i < profiles.length; ++i) {
this._pages[profiles[i] + ':' + pageName] = {
'name': pageName,
'controller': opt_controller,
'templateName': templateName,
'flags': opt_flags || {}
};
}
},
'get': function (pageName, profiles) {
for (var i = 0; i < profiles.length; ++i) {
var current = profiles[i];
var key = current.id + ':' + pageName;
var page = this._pages[key];
if (page) {
return [current, page];
}
}
return null;
}
};