Hey alex! Thank you so much for such a clear summary of the component library creation process. I followed your advice but can't seem to test this with a local project.
My component library is housed in the local directory "component-library". I used npm link ../component-library in my project. When I try to important Button from my component library, I get:
Error: Can't resolve './Button' in 'component-library/dist/esm/types/components'
Any advice on this? I've double checked my file structure versus yours at least 20 times.
Once you used "npm link" on your component library, also make sure to include that linked npm on your main app by using "npm link NAME_OF_YOUR_COMPONENT_PACKAGE", name is indicated on your component library' package.json name.
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey alex! Thank you so much for such a clear summary of the component library creation process. I followed your advice but can't seem to test this with a local project.
My component library is housed in the local directory "component-library". I used
npm link ../component-library
in my project. When I try to important Button from my component library, I get:Error: Can't resolve './Button' in 'component-library/dist/esm/types/components'
Any advice on this? I've double checked my file structure versus yours at least 20 times.
Once you used "npm link" on your component library, also make sure to include that linked npm on your main app by using "npm link NAME_OF_YOUR_COMPONENT_PACKAGE", name is indicated on your component library' package.json name.