Files
ohif-viewer/platform/viewer/src/index.js
T
Danny Brown d86f758125 ci: set NODE_ENV, fix out of memory issue, fix hot reload bundling
* ci: test docs-publish

* Specify to use prod

* Babel should transpile with env set by webpack

* chore: production defaults to true; set in --env.production by cli

* Remove lingering merge issue

* Add minimification plugins

* Need relative URLs to find root assets

* Default public url to forward slash in define plugin

* Don't wrap w/ react-hot-loader if we're building for production

* No need to log extensions

* Minimize using terser; and minimize css

* Import redux from es; this bypasses commonjs as import and fixes our "production build" warning

* Split commone webpack build for now to test hotfix

* postfix slash

* undefined safe env access

* Try to fix node_env prod issue w/ redux

* Set NODE_ENV production for all prod builds

* Syntax error

* nix tests

* Increase max amount of available memory

* Don't run bundle analyzer by default
2019-08-29 08:53:33 -04:00

51 lines
1.5 KiB
JavaScript

/**
* Entry point for development and production PWA builds.
* Packaged (NPM) builds go through `index-umd.js`
*/
import App from './App.js';
import React from 'react';
import ReactDOM from 'react-dom';
/**
* EXTENSIONS
* =================
*
* Importing and modifying the extensions our app uses HERE allows us to leverage
* tree shaking and a few other niceties. However, by including them here they become
* "baked in" to the published application.
*
* Depending on your use case/needs, you may want to consider not adding any extensions
* by default HERE, and instead provide them via the configuration specified at
* `window.config.extensions`, or by using the exported `App` component, and passing
* in your extensions as props.
*/
import OHIFVTKExtension from '@ohif/extension-vtk';
import OHIFDicomHtmlExtension from '@ohif/extension-dicom-html';
import OHIFDicomMicroscopyExtension from '@ohif/extension-dicom-microscopy';
import OHIFDicomPDFExtension from '@ohif/extension-dicom-pdf';
// Default Settings
let config = {};
const appDefaults = {
routerBasename: '/',
relativeWebWorkerScriptsPath: '',
};
if (window) {
config = window.config || {};
config.extensions = [
OHIFVTKExtension,
OHIFDicomHtmlExtension,
OHIFDicomMicroscopyExtension,
OHIFDicomPDFExtension,
];
}
const appProps = Object.assign({}, appDefaults, config);
// Create App
const app = React.createElement(App, appProps, null);
// Render
ReactDOM.render(app, document.getElementById('root'));