copy-with-symlinks
under development
this utility works as is, but does a lot of redundant copying. Please check it later.
why
If you have symbolic links in your node_modules
,
and run npm instal
or gulp-install
task, this will create new node_modules
folder for production with broken symbolic links. (not tested on linux or darwin)
copy-with-symlinks
utility will copy all folders from sourceRoot/dirName
to destinationRoot/dirName
with actual folders instead of symbolic links.
;
NOTE:
The destinationRoot/dirName
folder MUST NOT exist before this operation. This folder will be created. Otherwise strange things will happen to symlinks on Windows. (not tested on linux or darwin)
Symbolic links are great for private modules, but npm should handle it for production release.
To check if you have symbolic links in node_modules, look for little link arrows on the folder icon in file explorer:
This utility will copy any folder, not only node_modules
but it was specifically designed to work as a gulp task.
gulp use example
NOTE:
The copy-with-symlinks
only copies existing folders form DEV node_modules
to BUILD. Run npm install
in DEV before, to make sure that your modules are in order.
const gulp = ;const copyWithSymlinks = ; var dest = 'BUILD'; {console;} gulp;
option noDevDependencies
looks into package.json
file and excludes modules listed in devDependencies
node_modules
gulp - remove useless files and folders from try gulp-dmn
node_modules
advanced example - one task to copy and purge const gulp = ;const copyWithSymlinks = ;const gulpDmn = ; var dest = 'BUILD'; {console;} gulp;
requirements
tested on Win7 with NodeJS v8 and gulp v3
todo
This utility is synchronous (slow) for now. (Maybe if future I'll make it async)