mirror of
https://github.com/zadam/trilium.git
synced 2026-01-06 14:44:25 +01:00
fix(desktop/pdfjs): not working due to build script
This commit is contained in:
parent
413ee81ffa
commit
98cefcf77b
@ -1,7 +1,8 @@
|
|||||||
|
import { writeFileSync } from "fs";
|
||||||
import { join } from "path";
|
import { join } from "path";
|
||||||
|
|
||||||
import BuildHelper from "../../../scripts/build-utils";
|
import BuildHelper from "../../../scripts/build-utils";
|
||||||
import originalPackageJson from "../package.json" with { type: "json" };
|
import originalPackageJson from "../package.json" with { type: "json" };
|
||||||
import { writeFileSync } from "fs";
|
|
||||||
|
|
||||||
const build = new BuildHelper("apps/desktop");
|
const build = new BuildHelper("apps/desktop");
|
||||||
|
|
||||||
@ -18,9 +19,7 @@ async function main() {
|
|||||||
build.copyNodeModules([ "better-sqlite3", "bindings", "file-uri-to-path", "@electron/remote" ]);
|
build.copyNodeModules([ "better-sqlite3", "bindings", "file-uri-to-path", "@electron/remote" ]);
|
||||||
build.copy("/node_modules/ckeditor5/dist/ckeditor5-content.css", "ckeditor5-content.css");
|
build.copy("/node_modules/ckeditor5/dist/ckeditor5-content.css", "ckeditor5-content.css");
|
||||||
|
|
||||||
// Integrate the client.
|
build.buildFrontend();
|
||||||
build.triggerBuildAndCopyTo("apps/client", "public/");
|
|
||||||
build.deleteFromOutput("public/webpack-stats.json");
|
|
||||||
|
|
||||||
generatePackageJson();
|
generatePackageJson();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,12 +14,7 @@ async function main() {
|
|||||||
build.copyNodeModules([ "better-sqlite3", "bindings", "file-uri-to-path" ]);
|
build.copyNodeModules([ "better-sqlite3", "bindings", "file-uri-to-path" ]);
|
||||||
build.copy("/node_modules/ckeditor5/dist/ckeditor5-content.css", "ckeditor5-content.css");
|
build.copy("/node_modules/ckeditor5/dist/ckeditor5-content.css", "ckeditor5-content.css");
|
||||||
|
|
||||||
// Integrate the client.
|
build.buildFrontend();
|
||||||
build.triggerBuildAndCopyTo("apps/client", "public/");
|
|
||||||
build.deleteFromOutput("public/webpack-stats.json");
|
|
||||||
|
|
||||||
// pdf.js
|
|
||||||
build.triggerBuildAndCopyTo("packages/pdfjs-viewer", "pdfjs-viewer");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main();
|
main();
|
||||||
|
|||||||
@ -68,6 +68,14 @@ export default class BuildHelper {
|
|||||||
writeFileSync(join(this.outDir, "meta.json"), JSON.stringify(result.metafile));
|
writeFileSync(join(this.outDir, "meta.json"), JSON.stringify(result.metafile));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buildFrontend() {
|
||||||
|
this.triggerBuildAndCopyTo("apps/client", "public/");
|
||||||
|
this.deleteFromOutput("public/webpack-stats.json");
|
||||||
|
|
||||||
|
// pdf.js
|
||||||
|
this.triggerBuildAndCopyTo("packages/pdfjs-viewer", "pdfjs-viewer");
|
||||||
|
}
|
||||||
|
|
||||||
triggerBuildAndCopyTo(projectToBuild: string, destPath: string) {
|
triggerBuildAndCopyTo(projectToBuild: string, destPath: string) {
|
||||||
const projectDir = join(this.rootDir, projectToBuild);
|
const projectDir = join(this.rootDir, projectToBuild);
|
||||||
execSync("pnpm build", { cwd: projectDir, stdio: "inherit" });
|
execSync("pnpm build", { cwd: projectDir, stdio: "inherit" });
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user