Skip to content

Commit

Permalink
chore: use import source
Browse files Browse the repository at this point in the history
  • Loading branch information
fz6m committed Jan 6, 2024
1 parent 3ea60fc commit 4b5df57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/plugins/src/access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function accessProvider(container) {
content: `
import React, { PropsWithChildren } from 'react';
import { AccessContext } from './context';
import type { IRoute } from '@@/exports';
import type { IRoute } from '${api.appData.umi.importSource}';
export const useAccess = () => {
return React.useContext(AccessContext);
Expand Down
8 changes: 5 additions & 3 deletions packages/plugins/src/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ ${isFlattedDepsDir ? '/// <reference types="antd" />' : ''}
path: 'Layout.tsx',
content: `
${PKG_TYPE_REFERENCE}
import { Link, useLocation, useNavigate, Outlet, useAppData, useRouteData, matchRoutes } from 'umi';
import type { IRoute } from 'umi';
import {
Link, useLocation, useNavigate, Outlet, useAppData, matchRoutes,
type IRoute
} from '${api.appData.umi.importSource}';
import React, { useMemo } from 'react';
import {
ProLayout,
Expand Down Expand Up @@ -741,7 +743,7 @@ export default LogoIcon;
path: 'Exception.tsx',
content: `
import React from 'react';
import { history, type IRoute } from 'umi';
import { history, type IRoute } from '${api.appData.umi.importSource}';
import { Result, Button } from 'antd';
const Exception: React.FC<{
Expand Down

0 comments on commit 4b5df57

Please sign in to comment.