Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed May 9, 2024
1 parent bbb1e4f commit dde4e9f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/preset-umi/src/features/mako/mako.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import path from 'path';
import { IApi } from '../../types';
import { chalk } from '@umijs/utils';

export default (api: IApi) => {
api.describe({
Expand All @@ -21,15 +22,17 @@ export default (api: IApi) => {
});

api.onStart(() => {
if (!process.env.OKAM) {
process.env.OKAM = require.resolve('@umijs/bundler-mako');
}
process.env.OKAM = process.env.OKAM || require.resolve('@umijs/bundler-mako');
try {
const pkg = require(path.join(
require.resolve(process.env.OKAM),
'../package.json',
));
api.logger.info(`Using mako@${pkg.version}`);
const isBigfish = process.env.BIGFISH_INFO;
if (!isBigfish) {
api.logger.warn(chalk.yellow(chalk.bold(`Mako is an extremely fast, production-grade web bundler based on Rust. And it's still under active development and is not yet ready for production use. If you encounter any issues, please checkout https://makojs.dev/ to join the community and report the issue.`)));
}
} catch (e) {
console.error(e);
}
Expand Down

0 comments on commit dde4e9f

Please sign in to comment.