Skip to content

Commit

Permalink
Pass in public config
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Aug 24, 2022
1 parent 792963d commit 1971271
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/core/core/src/PackagerRunner.js
Expand Up @@ -38,6 +38,7 @@ import BundleGraph, {
bundleGraphToInternalBundleGraph,
} from './public/BundleGraph';
import PluginOptions from './public/PluginOptions';
import PublicConfig from './public/Config';
import {PARCEL_VERSION, HASH_REF_PREFIX, HASH_REF_REGEX} from './constants';
import {
fromProjectPath,
Expand Down Expand Up @@ -268,6 +269,7 @@ export default class PackagerRunner {
NamedBundle.get.bind(NamedBundle),
this.options,
),
config: new PublicConfig(config, this.options),
options: new PluginOptions(this.options),
logger: new PluginLogger({origin: plugin.name}),
});
Expand Down
1 change: 1 addition & 0 deletions packages/core/core/src/requests/ConfigRequest.js
Expand Up @@ -43,6 +43,7 @@ export type PluginWithLoadConfigGlobalInfo = {
loadBundleConfig?: ({|
bundle: INamedBundle,
bundleGraph: IBundleGraph<INamedBundle>,
config: IConfig,
options: IPluginOptions,
logger: IPluginLogger,
|}) => Async<mixed>,
Expand Down
2 changes: 2 additions & 0 deletions packages/core/types/index.js
Expand Up @@ -1600,6 +1600,7 @@ export type Packager<ConfigType, BundleConfigType> = {|
loadBundleConfig?: ({|
bundle: NamedBundle,
bundleGraph: BundleGraph<NamedBundle>,
config: Config,
options: PluginOptions,
logger: PluginLogger,
|}) => Async<BundleConfigType>,
Expand Down Expand Up @@ -1630,6 +1631,7 @@ export type Optimizer<ConfigType, BundleConfigType> = {|
loadBundleConfig?: ({|
bundle: NamedBundle,
bundleGraph: BundleGraph<NamedBundle>,
config: Config,
options: PluginOptions,
logger: PluginLogger,
|}) => Async<BundleConfigType>,
Expand Down

0 comments on commit 1971271

Please sign in to comment.