Skip to content

Commit

Permalink
fix: rc-util cannot resolve bug in pnpm project (#2096)
Browse files Browse the repository at this point in the history
* 馃懟 fix: ghost dependency

* Update src/features/meta.ts

Co-authored-by: Peach <scdzwyxst@gmail.com>

* Update src/features/theme/index.ts

---------

Co-authored-by: Peach <scdzwyxst@gmail.com>
  • Loading branch information
Wxh16144 and PeachScript committed May 6, 2024
1 parent e524190 commit 92ed416
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/features/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export default (api: IApi) => {
tplPath: require.resolve('../templates/meta/runtime.ts.tpl'),
context: {
deepmerge: winPath(path.dirname(require.resolve('deepmerge/package'))),
rc_util: winPath(path.dirname(require.resolve('rc-util/package'))),
},
});

Expand Down
1 change: 1 addition & 0 deletions src/features/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ export default DumiLoading;
api.config.themeConfig,
),
),
rc_util: winPath(path.dirname(require.resolve('rc-util/package'))),
_2_level_nav_available: api.appData._2LevelNavAvailable,
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/templates/ContextWrapper.ts.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useEffect, useRef } from 'react';
import { useOutlet, history } from 'dumi';
import { warning } from 'rc-util';
import { warning } from '{{{rc_util}}}';
import { SiteContext, type ISiteContext } from '{{{contextPath}}}';
import { components } from '../meta/atoms';
import { locales } from '../locales/config';
Expand Down
2 changes: 1 addition & 1 deletion src/templates/meta/runtime.ts.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { warning } from 'rc-util';
import { warning } from '{{{rc_util}}}';
import deepmerge from '{{{deepmerge}}}';
import { getRouteMetaById } from './exports';

Expand Down

0 comments on commit 92ed416

Please sign in to comment.