const gulp = require('gulp'); const utils = require('@joplin/tools/gulp/utils'); const compileSass = require('@joplin/tools/compileSass'); const compilePackageInfo = require('@joplin/tools/compilePackageInfo'); const tasks = { compileScripts: { fn: require('./tools/compileScripts'), }, compilePackageInfo: { fn: async () => { await compilePackageInfo(`${__dirname}/package.json`, `${__dirname}/packageInfo.js`); }, }, copyPluginAssets: { fn: require('./tools/copyPluginAssets.js'), }, copyTinyMceLangs: { fn: require('./tools/copyTinyMceLangs.js'), }, electronRebuild: { fn: require('./tools/electronRebuild.js'), }, tsc: require('@joplin/tools/gulp/tasks/tsc'), updateIgnoredTypeScriptBuild: require('@joplin/tools/gulp/tasks/updateIgnoredTypeScriptBuild'), buildCommandIndex: require('@joplin/tools/gulp/tasks/buildCommandIndex'), compileSass: { fn: async () => { await compileSass( `${__dirname}/style.scss`, `${__dirname}/style.min.css` ); }, }, }; utils.registerGulpTasks(gulp, tasks); const buildParallel = [ 'compileScripts', 'compilePackageInfo', 'copyPluginAssets', 'copyTinyMceLangs', 'updateIgnoredTypeScriptBuild', 'buildCommandIndex', 'compileSass', ]; gulp.task('build', gulp.parallel(...buildParallel));