Skip to content

Commit 0ef675a

Browse files
committed
add attribution to dist file
1 parent 9d436e9 commit 0ef675a

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

dist/jump.min.js

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

gulpfile.babel.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import babelify from 'babelify'
44
import browserify from 'browserify'
55
import gulp from 'gulp'
66
import connect from 'gulp-connect'
7+
import header from 'gulp-header'
78
import sourcemaps from 'gulp-sourcemaps'
89
import uglify from 'gulp-uglify'
910
import assign from 'lodash.assign'
@@ -24,11 +25,9 @@ const onError = (error) => {
2425
const attribution = [
2526
'/*!',
2627
' * Jump.js <%= pkg.version %> - <%= pkg.description %>',
27-
' * Copyright (c) 2015 <%= pkg.author %> - https://github.com/callmecavs/jump.js',
28+
' * Copyright (c) ' + new Date().getFullYear() + ' <%= pkg.author %> - <%= pkg.homepage %>',
2829
' * License: <%= pkg.license %>',
29-
' */',
30-
'',
31-
''
30+
' */'
3231
].join('\n')
3332

3433
// JS
@@ -57,7 +56,8 @@ const build = () => {
5756
.pipe(source('jump.min.js'))
5857
.pipe(buffer())
5958
.pipe(sourcemaps.init({ loadMaps: true }))
60-
.pipe(uglify())
59+
.pipe(header(attribution, { pkg: packageJSON }))
60+
.pipe(uglify({ preserveComments: 'some' }))
6161
.pipe(sourcemaps.write('./maps', { addComment: false }))
6262
.pipe(gulp.dest('dist'))
6363
.pipe(connect.reload())

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jump.js",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "A small, modern, dependency-free smooth scrolling library.",
55
"homepage": "https://github.com/callmecavs/jump.js",
66
"main": "dist/jump.min.js",
@@ -28,6 +28,7 @@
2828
"browserify": "*",
2929
"gulp": "*",
3030
"gulp-connect": "*",
31+
"gulp-header": "*",
3132
"gulp-sourcemaps": "*",
3233
"gulp-uglify": "*",
3334
"lodash.assign": "*",

0 commit comments

Comments
 (0)