Skip to content

Commit

Permalink
fix files content cache to allow only javascript and typescript files
Browse files Browse the repository at this point in the history
  • Loading branch information
wpdas committed Apr 24, 2024
1 parent 18bd484 commit 548e8c1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
24 changes: 16 additions & 8 deletions lib/config/filesContentCache.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,22 @@ const getFileContent = (filePath) => {
};

const updateFileContent = (filePath) => {
// Read file and save in cache
let fileContent = fs.readFileSync(filePath, "utf8");

// Run plugins
fileContent = runPlugins(fileContent);

// Store
filesContentCache[filePath] = fileContent;
// Javascript / Typescript files only
if (
filePath.endsWith(".ts") ||
filePath.endsWith(".tsx") ||
filePath.endsWith(".js") ||
filePath.endsWith(".jsx")
) {
// Read file and save in cache
let fileContent = fs.readFileSync(filePath, "utf8");

// Run plugins
fileContent = runPlugins(fileContent);

// Store
filesContentCache[filePath] = fileContent;
}
};

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "alem",
"description": "Create web3 applications for NEAR BOS with a focus on performance and friendly development.",
"version": "1.0.0-beta.29",
"version": "1.0.0-beta.30",
"main": "main.js",
"types": "index.d.ts",
"author": "Wenderson Pires - wendersonpires.near",
Expand Down

0 comments on commit 548e8c1

Please sign in to comment.