Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inversify-vanillajs-helpers should have peer dependency on inversify #822

Open
Xesenix opened this issue Mar 17, 2018 · 0 comments
Open

Comments

@Xesenix
Copy link

Xesenix commented Mar 17, 2018

When using inversify-vanillajs-helpers with webpack im seeing its being packed together with inversify adding unnecessary size:
inversify_duplicate_00

Expected Behavior

After installing inversify-vanillajs-helpers I don't get inversify in its dependencies that is node_modules/inversify-vanillajs-helpers/node_modules/inversify should not exists.

Current Behavior

When installing inversify-vanillajs-helpers it has duplicate of inversify in node_modules/inversify-vanillajs-helpers/node_modules/inversify.

Possible Solution

package.json in inversify-vanillajs-helpers

{
  ...
  "peerDependencies": {
    "inversify": "^4.11.0"
  }
  ...
}

Although I am not sure if its enough for gulp build (for example in rollup you need to set it additionally as external library).

Alternative would be to use for example https://github.com/alexjoverm/typescript-library-starter and set externals in rollup to 'inversify'.

  external: [
    'inversify',
  ],

But this one would require rewriting library to use rollup.

Steps to Reproduce (for bugs)

I have noticed it when trying out it in https://github.com/Xesenix/webpack-3-scaffold/tree/DI

  1. clone https://github.com/Xesenix/webpack-3-scaffold/tree/DI
  2. npm install
  3. npm run demo:analyze - this will show module dependencies like on that screen above

Context

Unnecessary increases size of build. Also it requires inversify-vanillajs-helpers library update to sync with inversify currently its locked at 4.11.0.

Your Environment

node v9.6.1
npm 5.7.1
https://github.com/Xesenix/webpack-3-scaffold/tree/DI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant