File tree 1 file changed +7
-8
lines changed
packages/@vuepress/core/lib/plugin-api
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ const { PLUGIN_OPTION_MAP } = require('./constants')
10
10
const {
11
11
moduleResolver : { getPluginResolver } ,
12
12
datatypes : { assertTypes, isPlainObject } ,
13
- env : { debug } ,
14
13
logger, chalk
15
14
} = require ( '@vuepress/shared-utils' )
16
15
@@ -210,13 +209,7 @@ module.exports = class PluginAPI {
210
209
alias
211
210
} ) {
212
211
const isInternalPlugin = pluginName . startsWith ( '@vuepress/internal-' )
213
- if ( ! isInternalPlugin || debug ) {
214
- logger . tip (
215
- shortcut
216
- ? `Apply plugin ${ chalk . magenta ( shortcut ) } ${ chalk . gray ( `(i.e. "${ pluginName } ")` ) } ...`
217
- : `Apply plugin ${ chalk . magenta ( pluginName ) } ...`
218
- )
219
- }
212
+ logger [ isInternalPlugin ? 'debug' : 'tip' ] ( pluginLog ( pluginName , shortcut ) )
220
213
221
214
this
222
215
. registerOption ( PLUGIN_OPTION_MAP . READY . key , ready , pluginName )
@@ -238,3 +231,9 @@ module.exports = class PluginAPI {
238
231
. registerOption ( PLUGIN_OPTION_MAP . ALIAS . key , alias , pluginName )
239
232
}
240
233
}
234
+
235
+ function pluginLog ( name , shortcut ) {
236
+ return shortcut
237
+ ? `Apply plugin ${ chalk . magenta ( shortcut ) } ${ chalk . gray ( `(i.e. "${ name } ")` ) } ...`
238
+ : `Apply plugin ${ chalk . magenta ( name ) } ...`
239
+ }
You can’t perform that action at this time.
0 commit comments