Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Can't bundle with rollup #727

Closed
Closed
@thdk

Description

@thdk

I've tried to import both from '@material/react-chips' and from '@material/react-chips/index' as well as some other attempts but each time without success.

Below are two of my attempts:

  1. import { Chip, ChipSet } from '@material/react-chips'

'ChipSet' is not exported by node_modules\@material\react-chips\dist\index.js

  1. import { Chip, ChipSet } from '@material/react-chips/index'

Error: 'MDCChipFoundation' is not exported by node_modules\@material\react-chips\node_modules\@material\chips\dist\mdc.chips.js

Note that for the second attempt I got the following error:

Error: Cannot call a namespace ('classnames')
node_modules\@material\react-chips\Chip.tsx (178:17)

Which is already address in another issue here: #709

I fixed that by changing the import for classnames in 'node_modules@material\react-chips\Chip.tsx'
from
import * as classnames from 'classnames';
to
import classnames from 'classnames';

I've create a small github repository with rollup setup here.

npm install + npm run build

Any ideas anyone how this can be set up correctly?

Issues likely to be related:
material-components/material-components-web#4135
#182
#703

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions