Open reinrl opened 5 years ago
As a side note: I also ran into an issue upon build, related to the optimization that occurs on a package I was attempting to depend on. For now, I have simply commented out the optimization block in this same file while I troubleshoot the issue - and I will report back here if this more widespread than just that specific package (which would likely actually be a create-react-app, as it appears like that particular block is mostly untouched coming from that project to this one).
I created a few different sample projects, using this project as a starting point - and I always seem to run into errors whenever attempting to bundle other libraries within mine (e.g., I want be dependent a form library, but don't want to force that dependency on a consuming application by using a devDependency/peerDependency combination).
As I had noted in issue #53, using libraries which I want to force the consuming application to specify a dependency on is relatively trivial (add to devDependency/peerDependency in my library, and add to the "externals" configuration within your webpack.config file(s).
In this particular case, I couldn't find a way to simply bundle another library without having to go that route - until I realized that I needed to add to the webpack output config (a libraryTarget attribute had already been added, but I needed to also specify library and umdNamedDefine attributes before this all worked for me). Now, I can simply add internal dependencies to my package.json's dependency array, and my consuming application is none the wiser.
(see this pull request for a proposed fix: https://github.com/DimiMikadze/create-react-library/pull/58)