diff --git a/.changeset/thin-toes-tell.md b/.changeset/thin-toes-tell.md new file mode 100644 index 000000000000..97aa05c62455 --- /dev/null +++ b/.changeset/thin-toes-tell.md @@ -0,0 +1,6 @@ +--- +'@modern-js/runtime': patch +--- + +fix(entry): compatible with jsx +fix(entry): 兼容 jsx diff --git a/packages/runtime/plugin-runtime/src/cli/template.ts b/packages/runtime/plugin-runtime/src/cli/template.ts index 3f62b063dc38..8a62f1753388 100644 --- a/packages/runtime/plugin-runtime/src/cli/template.ts +++ b/packages/runtime/plugin-runtime/src/cli/template.ts @@ -165,9 +165,9 @@ import App from '${ formatImportPath( customEntry ? entry - .replace('entry.tsx', 'App') + .replace(/entry\.[tj]sx/, 'App') .replace(srcDirectory, internalSrcAlias) - : entry.replace(srcDirectory, internalSrcAlias).replace('.tsx', ''), + : entry.replace(srcDirectory, internalSrcAlias).replace(/\.[tj]sx/, ''), ) }';