Fix build to include comment at top of file

This commit is contained in:
Zach Panzarino 2016-04-22 15:03:52 +00:00
parent 8e37b81378
commit 900d249646
3 changed files with 14 additions and 11 deletions

View File

@ -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({

View File

@ -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",

View File

@ -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);