optimize Simple Mode with true dead code elimination
This commit is contained in:
@@ -5,6 +5,14 @@ import { createIcons, icons } from 'lucide';
|
|||||||
import * as pdfjsLib from 'pdfjs-dist';
|
import * as pdfjsLib from 'pdfjs-dist';
|
||||||
import '../css/styles.css';
|
import '../css/styles.css';
|
||||||
|
|
||||||
|
const init = () => {
|
||||||
|
pdfjsLib.GlobalWorkerOptions.workerSrc = new URL(
|
||||||
|
'pdfjs-dist/build/pdf.worker.min.mjs',
|
||||||
|
import.meta.url
|
||||||
|
).toString();
|
||||||
|
|
||||||
|
// Handle simple mode - hide branding sections
|
||||||
|
if (__SIMPLE_MODE__) {
|
||||||
const hideBrandingSections = () => {
|
const hideBrandingSections = () => {
|
||||||
const nav = document.querySelector('nav');
|
const nav = document.querySelector('nav');
|
||||||
if (nav) {
|
if (nav) {
|
||||||
@@ -75,14 +83,6 @@ const hideBrandingSections = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const init = () => {
|
|
||||||
pdfjsLib.GlobalWorkerOptions.workerSrc = new URL(
|
|
||||||
'pdfjs-dist/build/pdf.worker.min.mjs',
|
|
||||||
import.meta.url
|
|
||||||
).toString();
|
|
||||||
|
|
||||||
// Handle simple mode - hide branding sections
|
|
||||||
if (__SIMPLE_MODE__) {
|
|
||||||
hideBrandingSections();
|
hideBrandingSections();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user