Skip to content

Instantly share code, notes, and snippets.

@cdcharlebois
Created May 24, 2023 14:22
Show Gist options
  • Save cdcharlebois/948fd0833a3163f9aa5cf3a1db236ae1 to your computer and use it in GitHub Desktop.
Save cdcharlebois/948fd0833a3163f9aa5cf3a1db236ae1 to your computer and use it in GitHub Desktop.
remove excess files from javascriptsource
find ./<mendix_project>/javascriptsource/<module_name>/node_modules -type f \
-not -name "*.js" \
-and -not -name "*.json" \
-and -not -name "*.ts" \
-and -not -name "*.jsx" \
-and -not -name "*.tsx" \
-and -not -name "*.js_commonjs-exports" \
-and -not -name "*.js.commonjs-module" \
| xargs rm -r
@cdcharlebois
Copy link
Author

can confirm that this works for windows (powershell):

Get-ChildItem .\node_modules -Recurse | Where{$_.Name -notmatch "(.js|.ts|.tsx|.jsx|.json|.js_commonjs-exports|.js_commonjs-module)$" -and !$_.PSIsContainer} | Remove-Item

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment