Skip to content

Commit

Permalink
Merge branch 'main' into docs/perf/remove-todos-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers authored Jun 3, 2024
2 parents 31a571d + c71307f commit ada35c2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions web-dev-server.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,13 @@ export default pfeDevServerConfig({
return next();
}
},
/** redirect requests for /(lib|elements)/*.js to *.ts */
function(ctx, next) {
if (!ctx.path.includes('node_modules') && ctx.path.match(/.*\/(lib|elements)\/.*\.js/)) {
ctx.redirect(ctx.path.replace('.js', '.ts'));
} else {
return next();
}
},
],
});

0 comments on commit ada35c2

Please sign in to comment.