You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.1 KiB
30 lines
1.1 KiB
// Generated by CoffeeScript 1.6.2
|
|
var Backbone, DocPad, createInstance, createMiddlewareInstance, pathUtil, queryEngine, _ref;
|
|
|
|
pathUtil = require('path');
|
|
|
|
_ref = require(__dirname + '/lib/docpad'), DocPad = _ref.DocPad, queryEngine = _ref.queryEngine, Backbone = _ref.Backbone, createInstance = _ref.createInstance, createMiddlewareInstance = _ref.createMiddlewareInstance;
|
|
|
|
module.exports = {
|
|
DocPad: DocPad,
|
|
queryEngine: queryEngine,
|
|
Backbone: Backbone,
|
|
createInstance: createInstance,
|
|
createMiddlewareInstance: createMiddlewareInstance,
|
|
require: function(relativePath) {
|
|
var absolutePath, err;
|
|
|
|
absolutePath = pathUtil.normalize(pathUtil.join(__dirname, relativePath));
|
|
if (absolutePath.replace(__dirname, '') === absolutePath) {
|
|
throw new Error("docpad.require is limited to local docpad files only: " + relativePath);
|
|
}
|
|
try {
|
|
require.resolve(absolutePath);
|
|
} catch (_error) {
|
|
err = _error;
|
|
absolutePath = pathUtil.join(__dirname, 'lib', relativePath);
|
|
require.resolve(absolutePath);
|
|
}
|
|
return require(absolutePath);
|
|
}
|
|
};
|