Skip to content

Commit

Permalink
chore: dev server load ts sources (#1580)
Browse files Browse the repository at this point in the history
fixes dev server loading build js. removes need to restart server for
css changes
  • Loading branch information
bennypowers authored May 30, 2024
1 parent bf0f15b commit c71307f
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 c71307f

Please sign in to comment.