From 187907a7e8cef03063861fa1922b46acd5f8b752 Mon Sep 17 00:00:00 2001 From: rart Date: Sun, 15 Nov 2020 12:24:41 +0100 Subject: [PATCH] Correction to samples --- README.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 9dcd270..4dba6d0 100644 --- a/README.md +++ b/README.md @@ -27,20 +27,11 @@ assignment syntax, so if you need to support browsers without that capability, y ## Sample -```js -// Original -import { createElement } from 'react'; -import { makeStyles, createStyles, Typography } from '@material-ui/core'; -import { useIntl } from 'react-intl'; -import jss from 'jss'; - -// ... -``` - ```js // rollup.config.js const globals = { + 'jss': 'window.libs.jss', 'react': 'window.libs.React', 'react-dom': 'window.libs.ReactDOM', '@material-ui/core': 'window.libs.MaterialUI' @@ -58,7 +49,17 @@ export default { ``` ```js -// transformed +// Original code +import { createElement } from 'react'; +import { makeStyles, createStyles, Typography } from '@material-ui/core'; +import { useIntl } from 'react-intl'; +import jss from 'jss'; + +// ... +``` + +```js +// Transformed output var { createElement } = window.libs.React; var { makeStyles, createStyles, Typography } = window.libs.MaterialUI; var { useIntl } = window.libs.ReactIntl;