mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
chore(NA): ability to add manual exceptions for the clean dll logic on the build (#51642)
This commit is contained in:
parent
320fa5a550
commit
1e6f9d54fe
1 changed files with 29 additions and 1 deletions
|
@ -66,10 +66,38 @@ export const CleanClientModulesOnDLLTask = {
|
|||
// side code entries that were provided
|
||||
const serverDependencies = await getDependencies(baseDir, serverEntries);
|
||||
|
||||
// This fulfill a particular exceptional case where
|
||||
// we need to keep loading a file from a node_module
|
||||
// only used in the front-end like we do when using the file-loader
|
||||
// in https://github.com/elastic/kibana/blob/master/x-pack/legacy/plugins/maps/public/connected_components/map/mb/view.js
|
||||
//
|
||||
// manual list of exception modules
|
||||
const manualExceptionModules = [
|
||||
'mapbox-gl'
|
||||
];
|
||||
|
||||
// consider the top modules as exceptions as the entry points
|
||||
// to look for other exceptions dependent on that one
|
||||
const manualExceptionEntries = [
|
||||
...manualExceptionModules.map(module => `${baseDir}/node_modules/${module}`)
|
||||
];
|
||||
|
||||
// dependencies for declared exception modules
|
||||
const manualExceptionModulesDependencies = await getDependencies(baseDir, [
|
||||
...manualExceptionEntries
|
||||
]);
|
||||
|
||||
// final list of manual exceptions to add
|
||||
const manualExceptions = [
|
||||
...manualExceptionModules,
|
||||
...manualExceptionModulesDependencies
|
||||
];
|
||||
|
||||
// Consider this as our whiteList for the modules we can't delete
|
||||
const whiteListedModules = [
|
||||
...serverDependencies,
|
||||
...kbnWebpackLoaders
|
||||
...kbnWebpackLoaders,
|
||||
...manualExceptions
|
||||
];
|
||||
|
||||
// Resolve the client vendors dll manifest path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue