mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.97k stars 32.28k forks source link

Building and publishing an add-on utility component for MUI #37177

Open brandonscript opened 1 year ago

brandonscript commented 1 year ago

Hey folks, I've built a small (TypeScript-enabled) utility component that extends MUI and I want to publish it on npm for easy installation. The component and its dependencies work fine if I copy and paste the files into a project (so far I've tested with Next.js and CRA), but I'm struggling to get it to transpile into a packagable format that doesn't cause a cornucopia of errors.

I've tried babel-loader, ts-loader, a combo of both, with and without webpack, and even though I can get it to generate files, they don't seem to work with React.

Trouble is I'm flying blind and just trying random things hoping they'll work. Now out of desperation, I'm hoping you might be able to point me in the direction of a build system or even documentation I could read that would help me?

Thanks!

mj12albert commented 1 year ago

@brandonscript Is there a repository you can share?

Maybe you can check out some of these related projects in the Material UI docs as a reference

brandonscript commented 1 year ago

Yep! https://github.com/brandonscript/mui-flexy

And good tip, I'll look through there and see if I can find some direction. Thanks!