It's quite magical and enforces a structure that makes it quite hard to use in monorepos.
I've been building monots recently to make managing library code a lot easier.
Some things I've noticed that I'm not a fan of at the moment.
napiplaces the platform specific code in a sub directory.npm/darwin-x64for example. I like all packages to be directly under thepackages/folder. I've looked at thenapicode and there's currently no way to change the destination directory.- I would like the files to be placed in the
packages/skribble.dev__css-darwin-x64folder. So I'll need to create my own custom scripts for it.
- I would like the files to be placed in the
- I'm not sure how the
optionalDependencieswork. I can see thatnapi prepublishadds them to the package.json file. But I need to find out if the optional dependencies are automatically installed by the package manager for the relevant platforms.- Okay, just had a look and it seems that
optionalDependencieswill attempt an install but not complain if it fails. Sonapiadds andosfield which is probably looked at by the package manager when deciding whether to install the dependency or not.
- Okay, just had a look and it seems that
I'm not sure whether it's possible to use esmodules.