2021-10-09 16:30:39 +02:00
|
|
|
const gulp = require('gulp');
|
|
|
|
const utils = require('@joplin/tools/gulp/utils');
|
|
|
|
const compilePackageInfo = require('@joplin/tools/compilePackageInfo');
|
|
|
|
const fs = require('fs-extra');
|
|
|
|
|
2021-12-20 17:48:40 +02:00
|
|
|
const distDir = `${__dirname}/dist`;
|
|
|
|
|
2021-10-09 16:30:39 +02:00
|
|
|
const tasks = {
|
|
|
|
compilePackageInfo: {
|
|
|
|
fn: async () => {
|
2021-12-20 17:48:40 +02:00
|
|
|
await fs.mkdirp(distDir);
|
|
|
|
await compilePackageInfo(`${__dirname}/package.json`, `${distDir}/packageInfo.js`);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
clean: {
|
|
|
|
fn: async () => {
|
|
|
|
await fs.remove(distDir);
|
2021-10-09 16:30:39 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
utils.registerGulpTasks(gulp, tasks);
|
|
|
|
|
|
|
|
const buildParallel = [
|
|
|
|
'compilePackageInfo',
|
|
|
|
];
|
|
|
|
|
|
|
|
gulp.task('build', gulp.parallel(...buildParallel));
|