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

[Feature request]: AfterDependenciesInstalled hook #5709

Closed
cawa-93 opened this issue Mar 13, 2021 · 8 comments
Closed

[Feature request]: AfterDependenciesInstalled hook #5709

cawa-93 opened this issue Mar 13, 2021 · 8 comments
Labels

Comments

@cawa-93
Copy link
Contributor

cawa-93 commented Mar 13, 2021

I need a method that would allow me to control exactly which dependencies come in the distributable package and which should be excluded.

For this I propose to hang a afterDependenciesInstalled hook that will fire immediately after the dependencies installed.

Use case:

Using bundles, such as rollup or Vite, some runtime dependencies are optimized and bundled into source code. This means that there is no need to keep these optimized dependencies in node_modules.

With afterDependenciesInstalled hook, we could remove dependencies that have already been optimized and bundled.

@mmaietta
Copy link
Collaborator

What about just manually specifying a negation in the files config?

    files: [
        "out",
        "!node_modules/some-package",
        "!**/*.node",
        "!**/*.LICENSE.txt",
        "!**/*.map"
    ],

The Documentation site says that all prod dependencies are automatically included because **/node_modules/**/* is appended, but my project actually excludes all dependencies via !node_modules due to the way we have to bundle the source code. Any negations seem to be prioritized over the 'allow' regexes, possibly order-based.

@cawa-93
Copy link
Contributor Author

cawa-93 commented Mar 18, 2021

@mmaietta I don't really understand how this should work.

Let's say I have a Vue as production dependency

Vue depends on @vue/compiler-dom, and that on @vue/compiler-core

Vue -> @vue/compiler-dom -> @vue/compiler-core

I can exclude Vue from the package, as you described, but all other dependencies will remain in the package

files: [
        "dist",
        "!node_modules/vue",
]

(nothing) -> @vue/compiler-dom -> @vue/compiler-core

@stale
Copy link

stale bot commented Jun 4, 2021

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the backlog label Jun 4, 2021
@cawa-93
Copy link
Contributor Author

cawa-93 commented Jun 4, 2021

Is this still relevant?

Yeap

@stale stale bot removed the backlog label Jun 4, 2021
@stale
Copy link

stale bot commented Sep 19, 2021

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the backlog label Sep 19, 2021
@cawa-93
Copy link
Contributor Author

cawa-93 commented Sep 20, 2021

Is this still relevant?

Ага

@stale stale bot removed the backlog label Sep 20, 2021
@mmaietta
Copy link
Collaborator

@stale
Copy link

stale bot commented Apr 17, 2022

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

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

No branches or pull requests

2 participants