diff --git a/gulpfile.js b/gulpfile.js index c2f2f91..e5774cd 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -3,6 +3,16 @@ let uglify = require('gulp-uglify'); let babel = require('gulp-babel'); let autoprefixer = require('gulp-autoprefixer'); let cleanCSS = require('gulp-clean-css'); +let header = require('gulp-header'); +let pkg = require('./package.json'); + +var jsBanner = ['/*!', + ' * DisqusJS | v<%= pkg.version %>', + ' * Author: SukkaW', + ' * Link: https://github.com/SukkaW/DisqusJS', + ' * License: <%= pkg.license %>', + ' */' + ].join('\n'); var configs = { browsers: [ @@ -28,11 +38,9 @@ gulp.task('minify-js', () => { ] })) .pipe(uglify({ - output: { - comments: /^!/ - }, keep_fnames: false })) + .pipe(header(jsBanner, { pkg: pkg })) .pipe(gulp.dest('dist')); }); diff --git a/package.json b/package.json index 06386f1..af27462 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "disqusjs", - "version": "0.1.1", - "description": "Show comments list from Disqus API", + "version": "0.1.3", + "description": "Alternative DISQUS - Render comments components from Disqus API", "main": "dist/disqus.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" @@ -12,6 +12,8 @@ }, "keywords": [ "Disqus", + "DisqusJS", + "SukkaW", "API", "XHR", "JSON" @@ -29,6 +31,7 @@ "gulp-autoprefixer": "^6.0.0", "gulp-babel": "^8.0.0", "gulp-clean-css": "^3.10.0", + "gulp-header": "^2.0.5", "gulp-uglify": "^3.0.1" } } diff --git a/yarn.lock b/yarn.lock index 48446eb..45e8509 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1028,6 +1028,13 @@ concat-stream@^1.6.0: readable-stream "^2.2.2" typedarray "^0.0.6" +concat-with-sourcemaps@*: + version "1.1.0" + resolved "https://registry.yarnpkg.com/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz#d4ea93f05ae25790951b99e7b3b09e3908a4082e" + integrity sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg== + dependencies: + source-map "^0.6.1" + console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" @@ -1563,6 +1570,15 @@ gulp-cli@^2.0.0: v8flags "^3.0.1" yargs "^7.1.0" +gulp-header@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/gulp-header/-/gulp-header-2.0.5.tgz#16e229c73593ade301168024fea68dab75d9d38c" + integrity sha512-7bOIiHvM1GUHIG3LRH+UIanOxyjSys0FbzzgUBlV2cZIIZihEW+KKKKm0ejUBNGvRdhISEFFr6HlptXoa28gtQ== + dependencies: + concat-with-sourcemaps "*" + lodash.template "^4.4.0" + through2 "^2.0.0" + gulp-uglify@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/gulp-uglify/-/gulp-uglify-3.0.1.tgz#8d3eee466521bea6b10fd75dff72adf8b7ea2d97" @@ -2024,11 +2040,31 @@ load-json-file@^1.0.0: pinkie-promise "^2.0.0" strip-bom "^2.0.0" +lodash._reinterpolate@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" + integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= + lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= +lodash.template@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.4.0.tgz#e73a0385c8355591746e020b99679c690e68fba0" + integrity sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A= + dependencies: + lodash._reinterpolate "~3.0.0" + lodash.templatesettings "^4.0.0" + +lodash.templatesettings@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz#2b4d4e95ba440d915ff08bc899e4553666713316" + integrity sha1-K01OlbpEDZFf8IvImeRVNmZxMxY= + dependencies: + lodash._reinterpolate "~3.0.0" + lodash@^4.13.1, lodash@^4.17.10: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"