mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
28 lines
620 B
JavaScript
28 lines
620 B
JavaScript
var types = require('./types');
|
|
|
|
var cache = {};
|
|
|
|
function load(path) {
|
|
// Only load a taglib once by caching the loaded taglibs using the file
|
|
// system path as the key
|
|
if (cache[path]) {
|
|
return cache[path];
|
|
}
|
|
|
|
var taglib = cache[path] = new types.Taglib(path);
|
|
|
|
exports.taglibLoader.loadTaglib(path, taglib);
|
|
|
|
cache[path] = taglib;
|
|
|
|
return taglib;
|
|
}
|
|
|
|
exports.clearCache = function() {
|
|
cache = {};
|
|
};
|
|
|
|
exports.load = load;
|
|
exports.taglibLoader = require('./loader-taglib');
|
|
exports.tagLoader = require('./loader-tag');
|
|
exports.attributeLoader = require('./loader-attribute'); |