Skip to content

Commit

Permalink
Add template replacement support in ts/tsx and js/jsx (#11)
Browse files Browse the repository at this point in the history
add template replacement support in ts/tsx and js/jsx
  • Loading branch information
MokujinMap committed May 31, 2024
1 parent e08c650 commit 4d17219
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/replace.middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') : '';

Expand Down

0 comments on commit 4d17219

Please sign in to comment.