Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to add manual exceptions for the clean dll logic during the build #51642

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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'
mistic marked this conversation as resolved.
Show resolved Hide resolved
];

// 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
Expand Down