Skip to content

Commit

Permalink
Add support for jsx and tsx file extensions
Browse files Browse the repository at this point in the history
Co-authored-by: Sunil Pai <[email protected]>
  • Loading branch information
GregBrimble and threepointone authored Jan 7, 2022
1 parent ca43b9e commit cade6c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/wrangler/pages/functions/filepath-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export async function generateConfigFromFileTree({

await forEachFile(baseDir, async (filepath) => {
const ext = path.extname(filepath);
if (/^\.(mjs|js|ts)$/.test(ext)) {
if (/^\.(mjs|js|ts|tsx|jsx)$/.test(ext)) {
// transform the code to ensure we're working with vanilla JS + ESM
const { code } = await transform(await fs.readFile(filepath, "utf-8"), {
loader: ext === ".ts" ? "ts" : "js",
Expand Down

0 comments on commit cade6c8

Please sign in to comment.