ohif-viewer/platform/viewer/src/index-umd.js
Gustavo André Lelis 69b96478cb * fix: 🐛 Enabling workbox to cache webfonts and fonts-stylesheets, add local fonts for UMD build (#906)
* fix: 🐛 commonjs/umd fonts import

Importing font into index-umd.js and creating a simple font css file
with font-face

Closes: #724

* fix: 🐛 Enabling workbox to cache webfonts and fonts-stylesheets

Closes: #724

* fix: 🐛 Adding all type of fonts from google - Roboto

Closes: #724
2019-09-27 11:11:05 +02:00

25 lines
628 B
JavaScript

/**
* Entry point index.js for UMD packaging
*/
import 'regenerator-runtime/runtime';
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App.js';
import './fonts/fonts.css';
function installViewer(props, containerId = 'root', callback) {
const container = document.getElementById(containerId);
if (!container) {
throw new Error(
"No root element found to install viewer. Please add a <div> with the id 'root', or pass a DOM element into the installViewer function."
);
}
return ReactDOM.render(<App {...props} />, container, callback);
}
export { App, installViewer };