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.
		
		
		
		
		
			
		
			
				
					
					
						
							18 lines
						
					
					
						
							471 B
						
					
					
				
			
		
		
	
	
							18 lines
						
					
					
						
							471 B
						
					
					
				var ensureRequire = require('../ensure-require.js') | 
						|
const throwError = require('../throw-error') | 
						|
 | 
						|
module.exports = function (templatePart, config) { | 
						|
  const options = (config && config['pug']) || {} | 
						|
  if (templatePart.filename) { | 
						|
    options.filename = templatePart.filename | 
						|
  } | 
						|
  var html | 
						|
  ensureRequire('pug', 'pug') | 
						|
  var jade = require('pug') | 
						|
  try { | 
						|
    html = jade.compile(templatePart.content, options)() | 
						|
  } catch (err) { | 
						|
    throwError(err) | 
						|
  } | 
						|
  return html | 
						|
}
 | 
						|
 |