Skip to content

Commit

Permalink
refactor code, slight cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Nov 6, 2023
1 parent a382a80 commit 68273aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/code-block-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ async function webpackLoader(content, map, meta) {
const findExactPath = (moduleName, imported) => {
let modulePath;
CATEGORIES.forEach((category) => {
const docsPath = path.resolve(__dirname, "..", "api-docs", "public", category, `${moduleName}.${imported}.html`);
const componentPath = `${category}/${moduleName}.${imported}.html`;
const docsPath = path.resolve(__dirname, "..", "api-docs", "public", componentPath);
if (fs.existsSync(docsPath)) {
modulePath = category + "/" + moduleName + "." + imported + ".html";
modulePath = componentPath
}
})
return modulePath;
Expand Down

0 comments on commit 68273aa

Please sign in to comment.