Skip to content
This repository has been archived by the owner on Apr 25, 2019. It is now read-only.

Plugin level package.json with React dependency causes issues. #32

Open
mikemurray opened this issue May 19, 2017 · 1 comment
Open

Comments

@mikemurray
Copy link
Member

reaction cli npm installs if it detects a package.jsoninside a plugin which is good. However, if something like react is installed in the local node_modules of a plugin then things go crazy when imported. Like the highlander, there can only be one.

Maybe theres a way to install some node modules to the root app node_modules so that we can avoid duplicate, conflicting modules.

I attempted to do so with script in the install script for npm like so:

inside /imports/plugins/custom/my-plugin
package.json

"scripts": {
  "install": "node scripts/install.js"
}

scripts/install.js

exec("npm install --prefix ../../../../../ install some-package");

Which seems to trigger on install when running reaction with reaction-cli. However, it's feels kinda brittle to do a npm install --prefix ../../../../../ install some-package if we were to ever move. And symlink plugins would require more path resolution logic.

@aaronjudd
Copy link

How do you know it's gone rogue? Is there a specific error in a console, or is this silent failure?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants