From 900d249646532170a8e1b0f98b2598839ab68a63 Mon Sep 17 00:00:00 2001 From: Zach Panzarino Date: Fri, 22 Apr 2016 15:03:52 +0000 Subject: [PATCH] Fix build to include comment at top of file --- gulpfile.js | 13 +++++++++++++ package.json | 1 + src/chart.js | 11 ----------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index b8c1cf21c..aed4b55fa 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -7,6 +7,7 @@ var gulp = require('gulp'), connect = require('gulp-connect'), replace = require('gulp-replace'), htmlv = require('gulp-html-validator'), + insert = require('gulp-insert'), inquirer = require('inquirer'), semver = require('semver'), exec = require('child_process').exec, @@ -23,6 +24,16 @@ var srcDir = './src/'; var outDir = './dist/'; var testDir = './test/'; +var header = "/*!\n\ + * Chart.js\n\ + * http://chartjs.org/\n\ + * Version: {{ version }}\n\ + *\n\ + * Copyright 2016 Nick Downie\n\ + * Released under the MIT license\n\ + * https://github.com/nnnick/Chart.js/blob/master/LICENSE.md\n\ + */\n"; + var preTestFiles = [ './node_modules/moment/min/moment.min.js', ]; @@ -57,6 +68,7 @@ function buildTask() { var bundled = browserify('./src/chart.js') .bundle() .pipe(source('Chart.bundle.js')) + .pipe(insert.prepend(header)) .pipe(streamify(replace('{{ version }}', package.version))) .pipe(gulp.dest(outDir)) .pipe(streamify(uglify({ @@ -69,6 +81,7 @@ function buildTask() { .ignore('moment') .bundle() .pipe(source('Chart.js')) + .pipe(insert.prepend(header)) .pipe(streamify(replace('{{ version }}', package.version))) .pipe(gulp.dest(outDir)) .pipe(streamify(uglify({ diff --git a/package.json b/package.json index c8830d93e..6a57df061 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "gulp-concat": "~2.1.x", "gulp-connect": "~2.0.5", "gulp-html-validator": "^0.0.2", + "gulp-insert": "~0.5.0", "gulp-jshint": "~1.5.1", "gulp-karma": "0.0.4", "gulp-replace": "^0.4.0", diff --git a/src/chart.js b/src/chart.js index 8f1b42855..6c2d8c51b 100644 --- a/src/chart.js +++ b/src/chart.js @@ -1,14 +1,3 @@ -/*! - * Chart.js - * http://chartjs.org/ - * Version: {{ version }} - * - * Copyright 2015 Nick Downie - * Released under the MIT license - * https://github.com/nnnick/Chart.js/blob/master/LICENSE.md - */ - - var Chart = require('./core/core.js')(); require('./core/core.helpers')(Chart); -- 2.47.2