MCPcopy Create free account
hub / github.com/11ty/dev-server / getBuildTemplatesFromFilePath

Method getBuildTemplatesFromFilePath

server.js:951–966  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

949
950 // returns [{ url, inputPath, content }]
951 getBuildTemplatesFromFilePath(path) {
952 // We can skip this for non-html files, dom-diffing will not apply
953 if(!path.endsWith(".html")) {
954 return [];
955 }
956
957 let urls = this.getUrlsFromFilePath(path);
958 let obj = {
959 inputPath: path,
960 content: fs.readFileSync(path, "utf8"),
961 }
962
963 return urls.map(url => {
964 return Object.assign({ url }, obj);
965 });
966 }
967
968 reloadFiles(files, useDomDiffingForHtml = true) {
969 if(!Array.isArray(files)) {

Callers 1

reloadFilesMethod · 0.95

Calls 1

getUrlsFromFilePathMethod · 0.95

Tested by

no test coverage detected