You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
416 B

import { IApi } from '@umijs/max';
export default (api: IApi) => {
api.modifyHTML(($) => {
const info = JSON.parse(process.env.VERSION || '{}');
const env = process.env.NODE_ENV;
$('html').attr(
'data-version',
env === 'production'
? info.version || info.commitId
: `dev-${info.commitId}`
);
return $;
});
api.onStart(() => {
console.log('start');
});
};