2023-11-12 17:07:30 +02:00
|
|
|
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`,
|
|
|
|
);
|
|
|
|
|
2024-03-11 17:02:15 +02:00
|
|
|
const pluginBackgroundPageBundle = new BundledFile(
|
|
|
|
'pluginBackgroundPage',
|
2024-06-25 14:59:59 +02:00
|
|
|
`${mobileDir}/components/plugins/backgroundPage/pluginRunnerBackgroundPage.ts`,
|
2024-03-11 17:02:15 +02:00
|
|
|
);
|
|
|
|
|
2024-03-20 13:01:09 +02:00
|
|
|
const noteViewerBundle = new BundledFile(
|
|
|
|
'noteBodyViewerBundle',
|
|
|
|
`${mobileDir}/components/NoteBodyViewer/bundledJs/noteBodyViewerBundle.ts`,
|
|
|
|
);
|
|
|
|
|
2023-11-12 17:07:30 +02:00
|
|
|
const gulpTasks = {
|
|
|
|
beforeBundle: {
|
|
|
|
fn: () => mkdirp(outputDir),
|
|
|
|
},
|
|
|
|
buildCodeMirrorEditor: {
|
|
|
|
fn: () => codeMirrorBundle.build(),
|
|
|
|
},
|
|
|
|
buildJsDrawEditor: {
|
|
|
|
fn: () => jsDrawBundle.build(),
|
|
|
|
},
|
2024-03-20 13:01:09 +02:00
|
|
|
buildNoteViewerBundle: {
|
|
|
|
fn: () => noteViewerBundle.build(),
|
|
|
|
},
|
2023-11-12 17:07:30 +02:00
|
|
|
watchCodeMirrorEditor: {
|
|
|
|
fn: () => codeMirrorBundle.startWatching(),
|
|
|
|
},
|
|
|
|
watchJsDrawEditor: {
|
|
|
|
fn: () => jsDrawBundle.startWatching(),
|
|
|
|
},
|
2024-03-11 17:02:15 +02:00
|
|
|
buildPluginBackgroundScript: {
|
|
|
|
fn: () => pluginBackgroundPageBundle.build(),
|
|
|
|
},
|
|
|
|
watchPluginBackgroundScript: {
|
|
|
|
fn: () => pluginBackgroundPageBundle.startWatching(),
|
|
|
|
},
|
2024-03-20 13:01:09 +02:00
|
|
|
watchNoteViewerBundle: {
|
|
|
|
fn: () => noteViewerBundle.startWatching(),
|
|
|
|
},
|
2023-11-12 17:07:30 +02:00
|
|
|
copyWebviewLib: {
|
|
|
|
fn: () => copyJs('webviewLib', `${mobileDir}/../lib/renderers/webviewLib.js`),
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export default gulpTasks;
|