docxtemplater-chart-module icon indicating copy to clipboard operation
docxtemplater-chart-module copied to clipboard

Changes needed to use gulp 4

Open colmben opened this issue 8 years ago • 1 comments

Hi, Apologies for leaving this in an issue but my fork is so far gone at this stage that a PR would be pointless. For anyone who is trying to make this package locally and an error re graceful-fs, you have to upgrade to the latest version of gulp (still in beta years later!) and make some minor changes to the gulpfile. The version can be got via package.json like this:

"gulp": "github:gulpjs/gulp#4.0"

in devDependencies.

The gulpfile needs a few tweaks, this one should work :

var gulp = require('gulp');
var watch= require('gulp-watch');
var coffee= require('gulp-coffee');
var uglify= require('gulp-uglify');

var config={uglify:false}

var paths = {
	coffee: ['coffee/docUtils.coffee','coffee/chartManager.coffee','coffee/index.coffee', 'coffee/chartMaker.coffee'],
	coffeeTest: ['coffee/test.coffee'],
	testDirectory:__dirname+'/test',
    js:'js/'
};

gulp.task('allCoffee', function (done) {
	gulp.src(paths.coffee)
        .pipe(coffee({bare:true}))
        .pipe(gulp.dest(paths.js))

	a=gulp.src(paths.coffeeTest)
		.pipe(coffee({map:true}))

	if(config.uglify)
		a=a.pipe(uglify())

	a=a
		.pipe(gulp.dest(paths.testDirectory));
    done();
});

gulp.task('watch', function () {
	gulp.src(paths.coffee)
		.pipe(watch(function(files) {
			var f=files.pipe(coffee({bare:true}))
				.pipe(gulp.dest(paths.js))
			return f;
		}));

	gulp.watch(paths.coffeeTest,['coffeeTest']);
});

gulp.task('coffeeTest', function() {
	a=gulp.src(paths.coffeeTest)
		.pipe(coffee({map:true}))

	if(config.uglify)
		a=a.pipe(uglify())

	a=a
		.pipe(gulp.dest(paths.testDirectory));

	return a;
});

gulp.task('default',gulp.series('coffeeTest' ,'watch', function(done) {
    done();
}));

colmben avatar Feb 21 '17 16:02 colmben

no. i follow your code. but it still not work for me.

luoboding avatar Jan 10 '18 06:01 luoboding