This project consist in a Gulp task for compress JS files.
Have installed and correctly configured:
- Linux :-)
- npm
- git
- nodejs
- gulp
Installing dependencies in Ubuntu/Debian.
sudo npm install nodejs nodejs-legacy npm git
Installing gulp via npm.
sudo npm install -g gulp
Dependencies: gulp gulp-logger gulp-uglify i npm pump recursive-readdir yargs
-
Clone the repository with the comand:
git clone https://github.com/frankdavidcorona/gcompress.git
-
Locate into the recent download folder:
cd gcompress
-
Install dependencies:
npm install
The task can accept two parameters called source and destino. The parameters must be passed with this format:
--source='/route/to/source'
--destino='/route/to/destino'
gulp gcompress --source='route/to/source' --destino='route/to/destino'
The output create in the destino a new folder named dist that's contains the result of the task.
By default the task will not obfuscate the code output, however this option can be changed by accessing the file:
gulpfile.js
Find this option:
var options = {mangle: false};
And change the mangle value to true.