From 4d17219a53bd31c403ac67b14e9820575b38baf5 Mon Sep 17 00:00:00 2001 From: MokujinMap <162605427+MokujinMap@users.noreply.github.com> Date: Fri, 31 May 2024 15:40:28 +0300 Subject: [PATCH] Add template replacement support in ts/tsx and js/jsx (#11) add template replacement support in ts/tsx and js/jsx --- tools/replace.middleware.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/replace.middleware.js b/tools/replace.middleware.js index 7bec2b3..b23c3d1 100644 --- a/tools/replace.middleware.js +++ b/tools/replace.middleware.js @@ -43,7 +43,7 @@ module.exports.replaceMiddleware = (dir) => (middleares, devServer) => { const mime = extMatch && EXT_MIME[extMatch[0]]; let rs = fs.createReadStream(file); - if (/\.html?$/.test(req.path)) { + if (/\.(html|tsx?|jsx?)$/.test(req.path)) { const readmeFile = path.join(dir, 'README.md'); const readme = fs.existsSync(readmeFile) ? fs.readFileSync(readmeFile, 'utf-8') : '';