Skip to content

Commit

Permalink
Correction to samples
Browse files Browse the repository at this point in the history
  • Loading branch information
rart committed Nov 15, 2020
1 parent 9a6b7b7 commit 187907a
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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;
Expand Down

0 comments on commit 187907a

Please sign in to comment.