Skip to content

Commit

Permalink
fix: unexpected exports in demo pre-compiling result
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript committed Oct 7, 2023
1 parent 5cb6003 commit 33e70f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/preset-dumi/src/transformer/demo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default (raw: string, opts: IDemoOpts): IDemoTransformResult => {
callPathNode.left.object.name === 'exports'
) {
// remove original export expression
if (types.isIdentifier(callPathNode.right)) {
if (types.isIdentifier(callPathNode.right) || types.isFunctionExpression(callPathNode.right)) {
// save export function as return statement arg
if (isDynamicEnable()) {
// for dynamic({ loader }), transform to return _default;
Expand Down

0 comments on commit 33e70f9

Please sign in to comment.