Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
gulp.task('combine', ['cleanDir', 'chartpark'], async () => {
await spawnCommand('gulp', ['rely']);
combineTool.config({
tmplFolder: 'tmpl',
srcFolder: 'build/src'
})
return combineTool.combine().then(() => {
console.log('complete');
}).catch(ex => {
console.log('gulpfile:', ex);
});
});
watch(tmplFolder + '/**/*', function(e) {
console.log(e.path);
if (path.extname(e.path) == '.scss') {
if (config.incrementBuild) {
return gulp.src([e.path])
.pipe($.sass().on('error', $.sass.logError))
.pipe($.autoprefixer(autoPrefixerConfig))
.pipe(gulp.dest(path.dirname(e.path)));
} else {
runSequence('sass');
}
return;
}
if (fs.existsSync(e.path)) {
combineTool.processFile(e.path);
} else {
combineTool.removeFile(e.path);
}
});
});
watch(tmplFolder + '/**/*', function(e) {
console.log(e.path);
if (fs.existsSync(e.path)) {
combineTool.processFile(e.path);
} else {
combineTool.removeFile(e.path);
}
});
});
watch(tmplFolder + '/**/*', function(e) {
console.log(e.path);
if (fs.existsSync(e.path)) {
combineTool.processFile(e.path);
} else {
combineTool.removeFile(e.path);
}
});
});
watch('./tmpl/**/*', e => {
if (fs.existsSync(e.path)) {
combineTool.processFile(e.path).catch(ex => {
console.log('ex', ex);
});
} else {
combineTool.removeFile(e.path);
}
});
});
watch(tmplFolder + '/**/*', function(e) {
console.log(e.path);
if (fs.existsSync(e.path)) {
combineTool.processFile(e.path);
} else {
combineTool.removeFile(e.path);
}
});
});
watch('./tmpl/**/*', e => {
if (fs.existsSync(e.path)) {
combineTool.processFile(e.path).catch(ex => {
console.log('ex', ex);
});
} else {
combineTool.removeFile(e.path);
}
});
});
console.log(e.path);
if (path.extname(e.path) == '.scss') {
if (config.incrementBuild) {
return gulp.src([e.path])
.pipe($.sass().on('error', $.sass.logError))
.pipe($.autoprefixer(autoPrefixerConfig))
.pipe(gulp.dest(path.dirname(e.path)));
} else {
runSequence('sass');
}
return;
}
if (fs.existsSync(e.path)) {
combineTool.processFile(e.path);
} else {
combineTool.removeFile(e.path);
}
});
});
watch(tmplFolder + '/**/*', function(e) {
console.log(e.path);
if (fs.existsSync(e.path)) {
combineTool.processFile(e.path);
} else {
combineTool.removeFile(e.path);
}
});
});
gulp.task('rely', () => {
combineTool.config({
log: false,
tmplFolder: 'dist',
srcFolder: 'build'
})
return combineTool.combine().then(() => {
console.log('complete');
}).catch(ex => {
console.log('gulpfile:', ex);
});
});