File tree Expand file tree Collapse file tree
packages/kbn-optimizer/src/optimizer Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919
2020import Path from 'path' ;
2121import Os from 'os' ;
22- import { getPluginSearchPaths } from '@kbn/dev-utils' ;
2322
2423import {
2524 Bundle ,
@@ -160,13 +159,19 @@ export class OptimizerConfig {
160159 throw new TypeError ( 'outputRoot must be an absolute path' ) ;
161160 }
162161
163- const pluginScanDirs =
164- options . pluginScanDirs ||
165- getPluginSearchPaths ( {
166- rootDir : repoRoot ,
167- oss,
168- examples,
169- } ) ;
162+ /**
163+ * BEWARE: this needs to stay roughly synchronized with
164+ * `src/core/server/config/env.ts` which determines which paths
165+ * should be searched for plugins to load
166+ */
167+ const pluginScanDirs = options . pluginScanDirs || [
168+ Path . resolve ( repoRoot , 'src/plugins' ) ,
169+ ...( oss ? [ ] : [ Path . resolve ( repoRoot , 'x-pack/plugins' ) ] ) ,
170+ Path . resolve ( repoRoot , 'plugins' ) ,
171+ ...( examples ? [ Path . resolve ( 'examples' ) ] : [ ] ) ,
172+ ...( examples && ! oss ? [ Path . resolve ( 'x-pack/examples' ) ] : [ ] ) ,
173+ Path . resolve ( repoRoot , '../kibana-extra' ) ,
174+ ] ;
170175
171176 if ( ! pluginScanDirs . every ( ( p ) => Path . isAbsolute ( p ) ) ) {
172177 throw new TypeError ( 'pluginScanDirs must all be absolute paths' ) ;
You can’t perform that action at this time.
0 commit comments