ant-design / ant-design-mobile

Essential UI blocks for building mobile web apps.
https://mobile.ant.design
MIT License
11.5k stars 2.37k forks source link

fix: createErrorBlock will lost the style cause treeshaking #6551

Closed hongxuWei closed 4 months ago

hongxuWei commented 4 months ago

Reproduce:

mkdir test-app
pnpm pnpm dlx create-umi@latest
cd test-app
// copy to ./src/pages/index.tsx
import { defaultImage } from 'antd-mobile/es/components/error-block/images';
import { createErrorBlock } from 'antd-mobile';

export const CustomErrorBlock = createErrorBlock({
  default: defaultImage,
  empty: 'https://example.img',
});

export default function HomePage() {
  return (
    <div>
      <CustomErrorBlock
        title="test"
      />
    </div>
  );
}
pnpm build

.adm-error-block is not found in dist css but pnpm dev is correct

github-actions[bot] commented 4 months ago

PR preview has been successfully built and deployed to https://antd-mobile-preview-pr-6551.surge.sh

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (76e3583) 92.27% compared to head (531392a) 92.27%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #6551 +/- ## ======================================= Coverage 92.27% 92.27% ======================================= Files 317 317 Lines 6904 6904 Branches 1729 1729 ======================================= Hits 6371 6371 Misses 497 497 Partials 36 36 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.