I\'d like to know if there is a way to uglify only one file in command line using r.js (RequireJS Optimizer) which is already installed in my computer. Like we can minify a css
I'll address how you can copy over a node package directly from one computer, because with this trick you'll have uglify, or clean-css or whatever package you want.
The background is that a node package includes copies of all its dependencies underneath its own install directory - this makes it easy to grab an entire package by a simple cp -r
or xcopy
if you're on Windows (which I don't claim to support)
Assuming one computer has an install of the clean-css
package
which cleancss
should show a path such as /usr/local/share/npm/bin/cleancss
, in which case you'll want to recursively copy /usr/local/share/npm/lib/node_modules/clean-css/
over to the other machine's corresponding node_modules folder (creating a symlink in /usr/local/share/npm/bin/
as well) to have access to that without the internet.