1var pug = require('./');
2var resolvedPug = JSON.stringify(require.resolve('./'));
3
4function compileTemplate(module, filename) {
5  var template = pug.compileFileClient(filename, {inlineRuntimeFunctions: false});
6  var body = "var pug = require(" + resolvedPug + ").runtime;\n\n" +
7             "module.exports = " + template + ";";
8  module._compile(body, filename);
9}
10
11if (require.extensions) {
12  require.extensions['.pug'] = compileTemplate
13};
14