mission.shrink
v1.0.1
Published
shrink the node_modules folder
Readme
mission.shrink
Caution - This will delete / minify / update the files. So please backup your files before run this command.
Init
It will initialize the shrink.json file.
shrink initshrink.json file
{
"path": "./node_modules",
"unlink": [
"*.d.ts",
"*.md",
"*LICENSE",
".npmignore"
],
"pkg": [] # name & main properties are default.
}
path: Relative path / full path of thenode_modulesfolder or any folder which containsjavascriptfiles. (Note: This tool willminifyordeleteormodifyyour files. so use withcaution)unlink: Provide the pattern (glob) to delete the files from the given folder.pkg: Declare the property name form the package.json file if it is required for production.
Shrink
it will shrink the node_modules folder based on the shrink.json file.
shrink [options]or
shrink --file shrink.json [options]or
shrink -f shrink.json [options]ex
shrink -r -c -m -s -vOptions
file
option: file - relative path of shrink.json file.
Alias: -f
Default value: shrink.json
Description:
removeDuplicate
option: removeDuplicate - remove .min.js file if the original file is available in node_modules folder.
Alias: -r
Default value: false
Description:
cleanup
option: cleanup - unlink unnecessary files form the node_modules folder.
Alias: -c
Default value: false
Description:
minify
option: minify - minify all javascript files located in node_modules folder.
Alias: -m
Default value: false
Description:
shrinkPkg
option: shrinkPkg - remove unused properties from package.json file.
Alias: -s
Default value: false
Description:
verbose
option: verbose - view detailed logs.
Alias: -v
Description:
Benifits
This util will reduce the node_modules folder size in docker container for production.
