mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-12-03 05:10:04 +01:00
17 lines
672 B
JavaScript
17 lines
672 B
JavaScript
const path = require('path');
|
|
const { compilePugTemplate } = require('./pug-template.cjs');
|
|
|
|
const angularHost = require(path.join(__dirname, '..', 'node_modules', '@angular', 'build', 'src', 'tools', 'angular', 'angular-host.js'));
|
|
const createAngularCompilerHost = angularHost.createAngularCompilerHost;
|
|
|
|
angularHost.createAngularCompilerHost = function (...args) {
|
|
const host = createAngularCompilerHost.apply(this, args);
|
|
const readResource = host.readResource;
|
|
host.readResource = async function (fileName) {
|
|
return fileName.endsWith('.pug') ? compilePugTemplate(fileName) : readResource.call(this, fileName);
|
|
};
|
|
return host;
|
|
};
|
|
|
|
global.angularPugHook = true;
|