Skip to content

Commit 67dc89c

Browse files
committed
Add Gulp Header for minified version
1 parent aa9636b commit 67dc89c

File tree

3 files changed

+23
-17
lines changed

3 files changed

+23
-17
lines changed

dist/jquery.stringToSlug.min.js

+6-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ var gulp = require( 'gulp' ),
22
del = require( 'del' ),
33
Karma = require( 'karma' ).Server,
44
$ = require( 'gulp-load-plugins' )( { lazy: true } ),
5-
config = require( './gulp.config.js' )();
5+
config = require( './gulp.config.js' )(),
6+
pkg = require('./package.json');
67

78
// List Tasks by default
89
gulp.task( 'default', $.taskListing );
@@ -15,11 +16,21 @@ gulp.task( 'hint', function() {
1516
.pipe( $.jscs() )
1617
} );
1718

19+
20+
var banner = ['/**',
21+
' * <%= pkg.name %> - <%= pkg.description %>',
22+
' * @version v<%= pkg.version %>',
23+
' * @link <%= pkg.homepage %>',
24+
' * @license <%= pkg.license %>',
25+
' */',
26+
''].join('\n');
27+
1828
gulp.task( 'minify', [ 'hint', 'clean-javascripts' ], function() {
1929
return gulp.src( config.jsSrc )
2030
.pipe( $.plumber() )
2131
.pipe( $.uglify( { mangle: true } ) )
2232
.pipe( $.rename( 'jquery.stringtoslug.min.js' ) )
33+
.pipe( $.header(banner, { pkg : pkg } ))
2334
.pipe( gulp.dest( config.jsDest ) )
2435
} );
2536

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "jquery-stringtoslug",
2+
"name": "jquery.stringtoslug",
33
"version": "2.0.0",
44
"description": "Convert a STRING to a SLUG in any language",
55
"main": "gulp.config.js",
@@ -32,7 +32,7 @@
3232
"bugs": {
3333
"url": "https://github.com/leocaseiro/jQuery-Plugin-stringToSlug/issues"
3434
},
35-
"homepage": "https://github.com/leocaseiro/jQuery-Plugin-stringToSlug#readme",
35+
"homepage": "https://github.com/leocaseiro/jQuery-Plugin-stringToSlug",
3636
"devDependencies": {
3737
"del": "^2.0.0",
3838
"gulp": "^3.9.0",
@@ -50,5 +50,8 @@
5050
"karma-phantomjs-launcher": "^0.2.1",
5151
"karma-qunit": "^0.1.5",
5252
"qunitjs": "^1.19.0"
53+
},
54+
"dependencies": {
55+
"gulp-header": "^1.7.1"
5356
}
5457
}

0 commit comments

Comments
 (0)