Skip to content

Commit

Permalink
fix(transformer): filename in babel options for demo local deps
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript committed Feb 1, 2021
1 parent ab1729f commit 84d3373
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/preset-dumi/src/transformer/demo/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface IDemoOpts {

export const getBabelOptions = ({ isTSX, fileAbsPath, transformRuntime }: IDemoOpts) => ({
// rename filename.md to filename.tsx to prevent babel transform failed
filename: isTSX ? fileAbsPath.replace(/\.\w+$/, '.tsx') : fileAbsPath,
filename: fileAbsPath.replace(/\.md$/, isTSX ? '.tsx' : '.jsx'),
presets: [
[
require.resolve('@umijs/babel-preset-umi/app'),
Expand Down

0 comments on commit 84d3373

Please sign in to comment.