index.js
function renderTemplateLoader(source) {
  // Get the loader options object.
  var options = getOptions(this)
  // Get the template locals.
  var locals = getLocals.call(this, options)
  // Create info object of the filename of the resource being loaded.
  var info = { filename: this.resourcePath }
  // Get the engine options to be passed to the engine.
  var engineOptions = getEngineOptions.call(this, options.engineOptions, info)
  // Get the template renderer
  var renderer = getRenderer.call(this, options.engine)
  // Call options.init.
  init.call(this, renderer.engine, info, options)
  // Render the template
  var result = render(renderer, source, locals, engineOptions)
  // Assign the tempate to module.exports.
  return 'module.exports = ' + JSON.stringify(result)
}
function renderTemplateLoader(source) {
  // Get the loader options object.
  var options = getOptions(this)
  // Get the template locals.
  var locals = getLocals.call(this, options)
  // Create info object of the filename of the resource being loaded.
  var info = { filename: this.resourcePath }
  // Get the engine options to be passed to the engine.
  var engineOptions = getEngineOptions.call(this, options.engineOptions, info)
  // Get the template renderer
  var renderer = getRenderer.call(this, options.engine)
  // Call options.init.
  init.call(this, renderer.engine, info, options)
  // Render the template
  var result = render(renderer, source, locals, engineOptions)
  // Assign the tempate to module.exports.
  return 'module.exports = ' + JSON.stringify(result)
}
function renderTemplateLoader ( source ) { // Get the loader options object. var options = getOptions ( this ) // Get the template locals. var locals = getLocals . call ( this , options ) // Create info object of the filename of the resource being loaded. var info = { filename : this . resourcePath } // Get the engine options to be passed to the engine. var engineOptions = getEngineOptions . call ( this , options . engineOptions , info ) // Get the template renderer var renderer = getRenderer . call ( this , options . engine ) // Call options.init. init . call ( this , renderer . engine , info , options ) // Render the template var result = render ( renderer , source , locals , engineOptions ) // Assign the tempate to module.exports. return 'module.exports = ' + JSON . stringify ( result ) }
The Render Template Loader

Render via supported template engines or a custom template renderer.

@this {webpack.loader.LoaderContext}
@param {string} source
@returns {string}
The Render Template Loader