3.10.1 • Published 7 years ago
sponge-rod v3.10.1
Sponge Rod
What is Sponge Rod?
Sponge Rod is a cli tool that build your assets css, js and images.
Installation
- Use
npm install --save-dev spongecommand in your terminal to install the dependency. - Also
gulp-climust be installed in your computer. To do that, usenpm install -g gulp-cli.
Commands
node node_modules/.bin/sponge [-h|--help]- Show command list.node node_modules/.bin/sponge init- Create file sponge.config.js.node node_modules/.bin/sponge sass- Compile the css file.node node_modules/.bin/sponge sass:watch- Compile the css file on every changes of sass file.node node_modules/.bin/sponge scripts- Compile the js file.node node_modules/.bin/sponge scripts:watch- Compile the js file on every changes of source js file.node node_modules/.bin/sponge build:views- Apply gulp-useref plugin and minify css and js files.node node_modules/.bin/sponge build:images- Optimize the file size of image and move the output file in 'build_images destination' provided of config file.node node_modules/.bin/sponge build:fonts- Just move the fonts inbuild_fonts destinationprovided of config file.node node_modules/.bin/sponge watch- Run commandsnode node_modules/.bin/sponge sass:watchandnode node_modules/.bin/sponge scripts:watch.node node_modules/.bin/sponge delete:dist- Remove dist folder.node node_modules/.bin/sponge build:dist- Run commandsnode node_modules/.bin/sponge delete:dist,node node_modules/.bin/sponge sass,node node_modules/.bin/sponge scripts,node node_modules/.bin/sponge build:views,node node_modules/.bin/sponge build:imagesandnode node_modules/.bin/sponge build:fonts.
Suggestion
I suggest to install npx node package in your local machine to execute the command simple.
Instead of for example node node_modules/.bin/sponge watch, you can achieve that with this very simple command npx sponge watch. Pretty cool ha!
Features
- Sponge Rod used
autoprefixer,csscombandmerge media queryplugins after compile the sass file into css file. - It used webpack comes from
webpack-streamplugin. - It decrease the file size of images without change the quality.
Sponge Rod configuration schema.
sass
Required
srcarray|string - Source files to be compiled.deststring - Output destination.
Optional
callbackfunction - This will be trigger after the sass command execute.optionsjson - The option ofgulp.srcfunction.commandstring - It would override thesasscommand.watch_commandstring - It would override thesass:watchcommand.notifyboolean - Show toast message after sass command task completed.
scripts
Required
entriesjson - Key is to be filename and the source file to be compiled.deststring - Output destination.
Optional
callbackfunction - This will be trigger after the scripts command execute.optionsjson - The option ofgulp.srcfunction.commandstring - It would override thescriptscommand.watch_commandstring - It would override thescripts:watchcommand.notifyboolean - Show toast message after scripts command task completed.
build_views
Required
srcarray|string - Source files to be compiled.deststring - Output destination.
Optional
callbackfunction - This will be trigger after the build:views command execute.optionsjson - The option ofgulp.srcfunction.commandstring - It would override thebuild:viewscommand.notifyboolean - Show toast message after build:views command task completed.
build_images
Required
srcarray|string - Source files to be compiled.deststring - Output destination.
Optional
callbackfunction - This will be trigger after the build:images command execute.optionsjson - The option ofgulp.srcfunction.commandstring - It would override thebuild:imagescommand.use_flattenboolean - Make the output files flatten.notifyboolean - Show toast message after build:images command task completed.
build_fonts
Required
srcarray|string - Source files to be compiled.deststring - Output destination.
Optional
callbackfunction - This will be trigger after the build:fonts command execute.optionsjson - The option ofgulp.srcfunction.commandstring - It would override thebuild:fontscommand.use_flattenboolean - Make the output files flatten.notifyboolean - Show toast message after build:fonts command task completed.
build
Optional
callbackfunction - To be call after build task completed.notifyboolean - Show toast message after build command task completed.
unbuild
Optional
dirstring|glob - Files or directory to be delete.callbackfunction - To be call after unbuild task completed.notifyboolean - Show toast message after unbuild command task completed.
Example
Checkout the example and test it in your local machine.
LICENSE
Sponge Rod is released under the MIT Licence.