mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
This commit is contained in:
parent
3687e6af16
commit
f220fb1c9e
1 changed files with 7 additions and 4 deletions
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
import { deleteAll, read, write } from '../../lib';
|
||||
import { dirname, sep } from 'path';
|
||||
import { dirname, sep, relative } from 'path';
|
||||
import pkgUp from 'pkg-up';
|
||||
import globby from 'globby';
|
||||
|
||||
|
@ -77,13 +77,16 @@ export async function cleanDllModuleFromEntryPath(logger, entryPath) {
|
|||
// NOTE: We can't use cwd option with globby
|
||||
// until the following issue gets closed
|
||||
// https://github.com/sindresorhus/globby/issues/87
|
||||
const deletePatterns = await globby([
|
||||
const filesToDelete = await globby([
|
||||
`${moduleDir}/**`,
|
||||
`!${moduleDir}/**/*.+(css)`,
|
||||
`!${moduleDir}/**/*.+(gif|ico|jpeg|jpg|tiff|tif|svg|png|webp)`,
|
||||
`!${modulePkgPath}`,
|
||||
]);
|
||||
await deleteAll(deletePatterns);
|
||||
|
||||
await deleteAll(filesToDelete.filter(path => {
|
||||
const relativePath = relative(moduleDir, path);
|
||||
return !relativePath.endsWith('package.json') || relativePath.includes('node_modules');
|
||||
}));
|
||||
|
||||
// Mark this module as cleaned
|
||||
modulePkg.cleaned = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue