Skip to content

Commit

Permalink
feat: alita loading
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohuoni authored Jun 6, 2022
2 parents b6c44d7 + 96564b5 commit 83b7419
Show file tree
Hide file tree
Showing 4 changed files with 201 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/funny-forks-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'alita': patch
---

feat: add alita dev loading
179 changes: 179 additions & 0 deletions packages/alita/assets/bundle-status.html

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions packages/alita/src/features/alitaloading.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { cheerio } from '@umijs/utils';
import { readFileSync } from 'fs';
import { join } from 'path';
import { IApi } from 'umi';

const assetsDir = join(__dirname, '../../assets');

export default (api: IApi) => {
api.register({
key: 'modifyDevToolLoadingHTML',
fn: () =>
cheerio.load(
readFileSync(join(assetsDir, 'bundle-status.html'), 'utf-8'),
),
});
};
1 change: 1 addition & 0 deletions packages/alita/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default (api: IApi) => {
});
const plugins = [
require.resolve('./features/config/alitaconfig'),
require.resolve('./features/alitaloading'),
require.resolve('./features/apptype'),
require.resolve('./features/qrcodeterminal'),
require.resolve('./commands/generate/pages'),
Expand Down

0 comments on commit 83b7419

Please sign in to comment.