![]() It's perhaps a compatibility issue in the way pnpm organizes packages in `node_modules` and how Meteor bundles those packages. I was trying out (), but couldn't get it to work out o … f the box with Meteor. I created this little demo repo to test different solutions for working with Meteor in monorepos, next up is and Sadly Meteor doesn’t (yet ) support pnpm at all. That’s why the nohoist option is needed.Īnd it works, no manual symlinking or scripts required. Luckily, later Yarn has introduced a nohoist configuration option, which allows us to use Yarn Workspaces and benefit from hoisting, except for the Meteor apps, which still want their modules strictly inside app directory’s own node_modules. Meteor does not, and will not ever, consider node_modules directories outside your application root directory, because that would require you to somehow recreate that surrounding environment on the server where you deploy your app. We used to use symlinking (which works well), but are looking at transitioning to the yarn workspace model (much faster install, less hand-written scripts). (Version have our Meteor app organized as a mono-repo with several plugin packages that are required by the Meteor app. ![]() However, Meteor’s bundler only looks for modules in the current node_modules folder, and when it cannot find it, it errors out. Apparently this is part of the npm specification, that it will resolve by looking into the current node_modules, but also in node_modules in the parent folder. The new Yarn workspaces feature to make it easier to work with monorepos relies on hoisting common npm packages to the parent directory. ![]() So we are using yalc at the moment, but this has other compatibility issues and complicates our CI setupĪnd finally Resolving npm modules from node_modules higher in parent folders We use a monorepo with several non-Meteor packages, but we can’t find a way to make this work with lerna or yarn workspaces. □ Meteor products that make money - #27 by jamesmillerburgess ![]() Yarn Workspaces, such asĪllow imports from directories above Meteor project root There’s been many posts on Github and this forum where people have trouble & requests for Meteor to support looking up node_modules higher up in the folder hierarchy to work with eg. I was always under the impression that Meteor doesn’t really play nice in monorepos. It can be done: GitHub - arggh/meteor-yarn-workspaces ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |