Monday 30 March 2020

Best way to build a docs site for an npm package?

HeyI have a React package I want to publish that, so it has a peerDependency on React.I also want to build an docs website, in the same repo.File structure will look like this:| - docsSite | - index.html | - app.js | - package.json (contains dependencies for React) | - src | - myPackage.js | package.json (contains only peerDependencies) app.js has something like this:import myPackage from '../src/myPackage.js' However, when running parcel inside /docsSite, React complains that there is 2 versions of React. I notice it has also updated the top level package.json (the one that belongs to myPackage) with a dependency for React.How do I overcome this? Or is it better to break off the documentation into it's own repo?Thanks

Submitted March 30, 2020 at 08:50PM by DonMildreone

No comments:

Post a Comment