[GeckoView] Reduce the size of the *built* viewer

Given that the GV-viewer isn't using most of the UI-related components of the default-viewer, we can avoid including them in the *built* viewer to save space.[1]
The least "invasive" way of implementing this, at least that I could come up with, is to leverage import maps with suitable stubs for the GV-viewer.

The one slightly annoying thing is that we now have larger import maps across multiple html-files, and you'll need to remember to update all of them when making future changes.

---
[1] With this patch, the built `viewer.js` size is 391 kB and `viewer-geckoview.js` is 285 kB.
This commit is contained in:
Jonas Jenwald 2023-02-04 13:55:12 +01:00
parent 05d821e680
commit a98e80c4ff
10 changed files with 150 additions and 34 deletions

View file

@ -13,8 +13,7 @@
* limitations under the License.
*/
import { ScrollMode, SpreadMode } from "./ui_utils.js";
import { CursorTool } from "./pdf_cursor_tools.js";
import { CursorTool, ScrollMode, SpreadMode } from "./ui_utils.js";
import { PagesCountLimit } from "./pdf_viewer.js";
/**