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') : '';