Skip to content

Commit 96a0fbb

Browse files
Sebastian McKenziebestander
authored andcommitted
Remove crappy folders from node_modules in dist tarballs (#1810)
* Remove crappy folders from node_modules in dist tarballs * add windows version of scripts/clean-node-modules
1 parent b4e42e3 commit 96a0fbb

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

scripts/build-dist.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ tar -xzf pack.tgz --strip 1
1414
rm pack.tgz
1515
# Change this to "yarn install --production" once #1115 is fixed
1616
npm install --production
17-
rm node_modules/*/test -Recurse
18-
rm node_modules/*/dist -Recurse
17+
../scripts/clean-node-modules.ps1
1918
cd ..

scripts/build-dist.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ tar -xzf pack.tgz --strip 1
1515
rm -rf pack.tgz
1616
# Change this to "yarn install --production" once #1115 is fixed
1717
npm install --production
18-
rm -rf node_modules/*/test node_modules/*/dist
18+
../scripts/clean-node-modules.sh
1919
../scripts/set-installation-method.js $(readlink -f package.json) tar
2020
cd ..
2121

scripts/clean-node-modules.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# sometimes folders may not exist according to node/npm version etc so ignore them
2+
$ErrorActionPreference = 'Continue'
3+
4+
# random browser builds that aren't used
5+
rm node_modules/core-js/client -Recurse
6+
7+
# remove typescript files
8+
rm node_modules/rx/ts -Recurse
9+
10+
# naughty modules that have their test folders
11+
rm node_modules/*/test -Recurse

scripts/clean-node-modules.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
# random browser builds that aren't used
4+
rm -rf node_modules/core-js/client
5+
6+
# remove typescript files
7+
rm -rf node_modules/rx/ts
8+
9+
# naughty modules that have their test folders
10+
rm -rf node_modules/*/test

0 commit comments

Comments
 (0)