mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 02:52:27 +08:00
build(copy-dist): add further cleanupNodeModules functionality
deleting of ts and map files from node_modules folder, adapted from copy-trilium.sh.
This commit is contained in:
parent
8275f3c867
commit
6749d8084b
@ -87,5 +87,18 @@ function cleanupNodeModules() {
|
|||||||
.map(el => path.join(DEST_DIR, el.parentPath, el.name))
|
.map(el => path.join(DEST_DIR, el.parentPath, el.name))
|
||||||
.forEach(dir => fs.removeSync(dir));
|
.forEach(dir => fs.removeSync(dir));
|
||||||
|
|
||||||
|
|
||||||
|
// Delete unnecessary files based on file extension
|
||||||
|
const filterableFileExt = new Set([
|
||||||
|
"ts",
|
||||||
|
"map"
|
||||||
|
])
|
||||||
|
|
||||||
|
nodeDir
|
||||||
|
// TriliumNextTODO: check if we can improve this naive file ext matching
|
||||||
|
.filter(el => el.isFile() && filterableFileExt.has(el.name.split(".").at(-1) || ""))
|
||||||
|
.map(file => path.join(DEST_DIR, file.parentPath, file.name))
|
||||||
|
.forEach(file => fs.removeSync(file));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,5 @@ if [[ -d "$BUILD_DIR"/node_modules ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
find $BUILD_DIR/libraries -name "*.map" -type f -delete
|
find $BUILD_DIR/libraries -name "*.map" -type f -delete
|
||||||
find $BUILD_DIR/node_modules -name "*.map" -type f -delete
|
|
||||||
find $BUILD_DIR -name "*.ts" -type f -delete
|
|
||||||
|
|
||||||
unset f d BUILD_DIR
|
unset f d BUILD_DIR
|
||||||
|
Loading…
x
Reference in New Issue
Block a user