feat: add local DICOM and canvas PDF previews

This commit is contained in:
SantaSpeen committed 2026-10-22 01:25:48 +03:00
1 parent b569f68300
commit dd29258828
18 files changed
+960 -6

No files matched your search

+23
View File
@@ -42,7 +42,30 @@ function bundledAceAssets(): Plugin {
};
}
function bundledPdfAssets(): Plugin {
return {
name: "bundled-pdf-assets",
apply: "build",
generateBundle() {
const root = path.resolve(import.meta.dirname, "node_modules/pdfjs-dist");
const version = JSON.parse(
fs.readFileSync(path.join(root, "package.json"), "utf8")
).version;
for (const folder of ["cmaps", "standard_fonts"]) {
for (const name of fs.readdirSync(path.join(root, folder))) {
this.emitFile({
type: "asset",
fileName: `pdfjs/${version}/${folder}/${name}`,
source: fs.readFileSync(path.join(root, folder, name)),
});
}
}
},
};
}
const plugins = [
bundledPdfAssets(),
bundledAceAssets(),
vue(),
VueI18nPlugin({