html-webpack-plugin/examples/javascript-advanced/template.js

15 lines
503 B
JavaScript

// Webpack require:
var partial = require('./partial.html');
var universal = require('./universial.js');
// Export a function / promise / or a string:
// This function has to return a string or promised string:
module.exports = function (templateParams) {
var filename = __filename;
var html = '<html><head>' +
'<title>' + filename + ': ' + templateParams.htmlWebpackPlugin.options.title + '</title>' +
'</head><body>' + universal() + ' - ' + partial + '</body></html>';
return html;
};