Skip to content

UMD package: export MaterialUI variable #12387

@tkrotoff

Description

@tkrotoff

Currently to use Material-UI with codepen.io, JSFiddle... you have to write (see https://stackoverflow.com/q/50705423):

const { Button, Input } = window['material-ui'];

This is because the output name inside rollup.config.js is 'material-ui':
https://github.com/mui-org/material-ui/blob/8013fdd36d40980ebb8f116f20e2843b781c0c39/packages/material-ui/scripts/rollup.config.js#L10

Instead it should be a name without -, something like 'MaterialUI':

const { Button, Input } = MaterialUI;

rollup.config.js example:

https://github.com/tkrotoff/react-form-with-constraints/blob/b64119bee6ab80c77417a9284a704b380b81bf5e/packages/react-form-with-constraints/rollup.config.js#L19-L27

Related issue: #7621

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changeIntroduces changes that are not backward compatible.type: new featureExpand the scope of the product to solve a new problem.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions