mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Allow plugins to integrate more deeply with webpack where necessary by supporting `__webpackPluginProvider__` uiExports which will be called and expected to return a wepack plugin that will be included in the compiler configuration that Kibana uses.
This commit is contained in:
parent
ecffcad31f
commit
b39a2c9966
4 changed files with 10 additions and 0 deletions
|
@ -153,6 +153,9 @@ export default class BaseOptimizer {
|
|||
}),
|
||||
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
|
||||
...this.uiBundles.getWebpackPluginProviders()
|
||||
.map(provider => provider(webpack)),
|
||||
],
|
||||
|
||||
module: {
|
||||
|
|
|
@ -48,6 +48,7 @@ export class UiBundlesController {
|
|||
...getWebpackAliases(pluginSpecs),
|
||||
...uiExports.webpackAliases
|
||||
};
|
||||
this._webpackPluginProviders = uiExports.webpackPluginProviders;
|
||||
this._webpackNoParseRules = uiExports.webpackNoParseRules;
|
||||
this._postLoaders = [];
|
||||
this._bundles = [];
|
||||
|
@ -78,6 +79,10 @@ export class UiBundlesController {
|
|||
}
|
||||
}
|
||||
|
||||
getWebpackPluginProviders() {
|
||||
return this._webpackPluginProviders || [];
|
||||
}
|
||||
|
||||
getWebpackNoParseRules() {
|
||||
return this._webpackNoParseRules;
|
||||
}
|
||||
|
|
|
@ -54,4 +54,5 @@ export {
|
|||
noParse,
|
||||
__globalImportAliases__,
|
||||
__bundleProvider__,
|
||||
__webpackPluginProvider__,
|
||||
} from './webpack_customizations';
|
||||
|
|
|
@ -7,6 +7,7 @@ import { alias, wrap, uniqueKeys, mapSpec } from './modify_reduce';
|
|||
|
||||
export const __globalImportAliases__ = wrap(alias('webpackAliases'), uniqueKeys('__globalImportAliases__'), mergeAtType);
|
||||
export const __bundleProvider__ = wrap(alias('uiBundleProviders'), flatConcatAtType);
|
||||
export const __webpackPluginProvider__ = wrap(alias('webpackPluginProviders'), flatConcatAtType);
|
||||
export const noParse = wrap(
|
||||
alias('webpackNoParseRules'),
|
||||
mapSpec(rule => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue