1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00
joplin/packages/app-mobile/tools/buildInjectedJs/gulpTasks.ts

61 lines
1.5 KiB
TypeScript
Raw Normal View History

import BundledFile from './BundledFile';
import { mkdirp } from 'fs-extra';
import { mobileDir, outputDir } from './constants';
import copyJs from './copyJs';
const codeMirrorBundle = new BundledFile(
'codeMirrorBundle',
`${mobileDir}/components/NoteEditor/CodeMirror/CodeMirror.ts`,
);
const jsDrawBundle = new BundledFile(
'svgEditorBundle',
`${mobileDir}/components/NoteEditor/ImageEditor/js-draw/createJsDrawEditor.ts`,
);
const pluginBackgroundPageBundle = new BundledFile(
'pluginBackgroundPage',
`${mobileDir}/plugins/PluginRunner/backgroundPage/pluginRunnerBackgroundPage.ts`,
);
const noteViewerBundle = new BundledFile(
'noteBodyViewerBundle',
`${mobileDir}/components/NoteBodyViewer/bundledJs/noteBodyViewerBundle.ts`,
);
const gulpTasks = {
beforeBundle: {
fn: () => mkdirp(outputDir),
},
buildCodeMirrorEditor: {
fn: () => codeMirrorBundle.build(),
},
buildJsDrawEditor: {
fn: () => jsDrawBundle.build(),
},
buildNoteViewerBundle: {
fn: () => noteViewerBundle.build(),
},
watchCodeMirrorEditor: {
fn: () => codeMirrorBundle.startWatching(),
},
watchJsDrawEditor: {
fn: () => jsDrawBundle.startWatching(),
},
buildPluginBackgroundScript: {
fn: () => pluginBackgroundPageBundle.build(),
},
watchPluginBackgroundScript: {
fn: () => pluginBackgroundPageBundle.startWatching(),
},
watchNoteViewerBundle: {
fn: () => noteViewerBundle.startWatching(),
},
copyWebviewLib: {
fn: () => copyJs('webviewLib', `${mobileDir}/../lib/renderers/webviewLib.js`),
},
};
export default gulpTasks;