docxtemplater-chart-module
docxtemplater-chart-module copied to clipboard
Changes needed to use gulp 4
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();
}));
no. i follow your code. but it still not work for me.