Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
fix: 关闭 react-devtool 默认集成
Browse files Browse the repository at this point in the history
  • Loading branch information
sydeEvans committed May 20, 2022
1 parent 5636b85 commit 8e741d8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions packages/remax-cli/src/builtinPlugins.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import errorScreen from '@remax/plugin-error-screen';
import devtools from '@remax/plugin-devtools';
// import devtools from '@remax/plugin-devtools';
import type { Options, Plugin } from '@remax/types';

export const builtinPlugins = (
Expand All @@ -8,18 +8,18 @@ export const builtinPlugins = (
optionKey: string;
init: (...args: any[]) => Plugin;
}> => {
const isDev = process.env.NODE_ENV !== 'production';
// const isDev = process.env.NODE_ENV !== 'production';
const plugins = [
{
optionKey: 'errorScreen',
init: errorScreen,
},
];
if (options.target !== 'web' && isDev && options.devtools) {
plugins.push({
optionKey: 'devtools',
init: devtools,
});
}
// if (options.target !== 'web' && isDev && options.devtools) {
// plugins.push({
// optionKey: 'devtools',
// init: devtools,
// });
// }
return plugins;
};
12 changes: 6 additions & 6 deletions packages/remax-cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ export default class RemaxCLI {
type: 'boolean',
default: false,
})
.option('devtools', {
describe: '启动 react-devtools 调试',
alias: 'd',
type: 'boolean',
default: true,
})
// .option('devtools', {
// describe: '启动 react-devtools 调试',
// alias: 'd',
// type: 'boolean',
// default: true,
// })
.option('loglevel', {
describe: '展示日志级别',
type: 'string',
Expand Down

0 comments on commit 8e741d8

Please sign in to comment.