Skip to content

UniversalViewer/example-electron

Repository files navigation

Universal Viewer Electron CJS Example

This example shows how to load the Universal Viewer CommonJS build (dist/cjs/index.js) into an Electron renderer process.

Setup

From npm-examples/electron-cjs-example:

npm install

Run

npm start

The TypeScript source files are in src/, and compiled output is written to dist/ before Electron starts.

Package

npm run build

This packages the example as a Windows desktop app into release/ using electron-packager.

The Electron window loads the Universal Viewer using require('universalviewer/dist/cjs/index.js') inside the renderer.

src/renderer.ts also installs a runtime hook for .css and .less imports so the Universal Viewer CJS package can load its styles correctly in Electron.

About

An example of deploying UV using Electron

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors