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.

22 lines
510 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}`
);
if (env === 'production') {
$('script[src^="/js/umi"]').first?.().remove?.();
}
return $;
});
api.onStart(() => {
console.log('start');
});
};