-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add minified version, update markdown
- Loading branch information
1 parent
bc6b7db
commit b181b5c
Showing
7 changed files
with
105 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Specifies intentionally untracked files to ignore when using Git | ||
# http://git-scm.com/docs/gitignore | ||
|
||
node_modules/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
|
||
// define all gulp plugin to used | ||
// define plugin if required | ||
// some of plugins can be used together with others plugin | ||
var gulp = require('gulp'); | ||
var jshint = require('gulp-jshint'); | ||
var concat = require('gulp-concat'); | ||
var uglify = require('gulp-uglify'); | ||
|
||
//this plugin for debug js file, will display error and correction into console | ||
gulp.task('jshint', function(){ | ||
|
||
var srcJs = './jquery.metalClone.js'; // js source files | ||
gulp.src(srcJs) | ||
.pipe(jshint()) | ||
.pipe(jshint.reporter('default')); | ||
}); | ||
|
||
|
||
|
||
|
||
|
||
//this function to concat(can be used to concat css file also) all js file and code, strip empty space js file | ||
//This example passes an array of filenames to gulp.src(); I want scripts.js to appear at the top of the production file followed by all other JavaScript files in any order. | ||
gulp.task('myJs', function(){ | ||
|
||
gulp.src(['./jquery.metalClone.js']) | ||
.pipe(concat('jquery.metalClone.min.js')) | ||
//.pipe(stripDebug()) | ||
.pipe(uglify()) | ||
.pipe(gulp.dest('./')); | ||
}); | ||
|
||
|
||
|
||
|
||
//to run all the task sekaligus(sequence) guna code ni | ||
//just run 'gulp' command on console to run the default task | ||
gulp.task('default', ['jshint','myJs'], function(){ | ||
|
||
|
||
|
||
/********************************** optional buang kod dalm block ni shaja klu xse(to watch the changes realtime use this)**********/ | ||
|
||
// watch for HTML changes | ||
gulp.watch('./src/*.html', function() { | ||
gulp.run('minifyHtml'); | ||
}); | ||
|
||
// watch for JS changes | ||
gulp.watch('./src/scripts/*.js', function() { | ||
gulp.run('jshint', 'scripts'); | ||
}); | ||
|
||
// watch for CSS changes | ||
gulp.watch('./src/styles/*.css', function() { | ||
gulp.run('css'); | ||
}); | ||
|
||
/***************************** end optional **************************/ | ||
|
||
}); | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "metalClone", | ||
"version": "1.0.1", | ||
"description": "jQuery plugin clone DOM element", | ||
"main": "index.js", | ||
"dependencies": { | ||
"gulp": "^3.8.11", | ||
"gulp-concat": "^2.5.2", | ||
"gulp-jshint": "^1.9.0", | ||
"gulp-uglify": "^1.0.2" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [ | ||
"hello" | ||
], | ||
"author": "norlihazmey@metallurgical", | ||
"license": "MIT" | ||
} |