statigen
Version:
A static site generator that supports html, ejs, and markdown source files
28 lines • 1.16 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.InternalPlugin = void 0;
const path = require("path");
const HtmlFile_1 = require("./files/HtmlFile");
const MarkdownFile_1 = require("./files/MarkdownFile");
const RawFile_1 = require("./files/RawFile");
const EjsFile_1 = require("./files/EjsFile");
class InternalPlugin {
provideFile(event) {
const extension = path.extname(event.srcPath).toLowerCase();
if (extension === '.html') {
return new HtmlFile_1.HtmlFile(event.srcPath, event.outPath);
}
else if (extension === '.md') {
return new MarkdownFile_1.MarkdownFile(event.srcPath, event.outPath);
}
else if (extension === '.ejs') {
return new EjsFile_1.EjsFile(event.srcPath, event.outPath);
}
else {
//all other files are handled by this class. It doesn't load the file into memory, and simply copies the file to outDir on build
return new RawFile_1.RawFile(event.srcPath, event.outPath);
}
}
}
exports.InternalPlugin = InternalPlugin;
//# sourceMappingURL=InternalPlugin.js.map
;