reptar watch
. :/
/**
* Get File/CollectionPage based on request.path.
* @param {string} requestPath Request path to server.
* @return {File|CollectionPage}
*/
getFile(requestPath) {
let file = this.index[requestPath];
console.log(requestPath);
console.log(file);
if (!file) {
file = this.index[path.join(requestPath, 'index.html')];
}
return file;
}
Starting watch.
√ Reading theme files. (193ms)
√ Loading plugins. (77ms)
√ Reading files. (18ms)
√ Reading collections. (5ms)
Starting watch. (361ms)
info: Server running at: http://127.0.0.1:8080
/
undefined
info: Rendering CollectionPage post:0
/css/main-9048261e4d.css
undefined
- Reading theme files. /js/main-c614ff7b24.js
undefined
√ Reading theme files. (87ms)
√ Loading plugins. (1ms)
√ Reading theme files. (86ms)
√ Loading plugins. (1ms)
√ Reading files. (21ms)
√ Reading collections. (1ms)
/css/main-9048261e4d.css
undefined
√ Reading files. (12ms)
√ Reading collections. (2ms)
/js/main-c614ff7b24.js
undefined
this.index[requestPath];
it becomes undefined
themeHandler(request, reply) {
const requestPath = request.path;
console.log("requestPath:", requestPath);
// Find an associated theme asset.
const requestAsset = _.find(this.reptar.theme.assets, (asset) => {
const destination = this.relativeDestination(
asset.processor && asset.destination ?
asset.destination :
asset.config.destination
);
return requestPath.includes(destination);
});
console.log("requestAsset:", requestAsset);
Starting watch.
√ Reading theme files. (197ms)
√ Loading plugins. (83ms)
√ Reading files. (20ms)
√ Reading collections. (6ms)
Starting watch. (377ms)
info: Server running at: http://127.0.0.1:8080
info: Rendering CollectionPage post:0
requestPath: /css/main-9048261e4d.css
requestAsset: undefined
- Reading theme files. requestPath: /js/main-c614ff7b24.js
requestAsset: undefined
√ Reading theme files. (82ms)
√ Loading plugins. (1ms)
√ Reading theme files. (84ms)
√ Loading plugins. (1ms)
√ Reading files. (21ms)
√ Reading files. (8ms)
√ Reading collections. (2ms)
√ Reading collections. (1ms)