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

add an optional cache and exclude option to the onResolve plugin hook #3666

Open
sod opened this issue Feb 23, 2024 · 1 comment
Open

add an optional cache and exclude option to the onResolve plugin hook #3666

sod opened this issue Feb 23, 2024 · 1 comment

Comments

@sod
Copy link
Contributor

sod commented Feb 23, 2024

As the angular-cli right now fully commits to esbuild, the onResolve hook reveals itself as a pretty stark performance hinderance to the otherwise astonishing speed of esbuild.

In my mind this is how the API could look like to improve:

build.onResolve({ filter: /^[^./]/, exclude: /^(@angular|rxjs)\// } }, async (args) => {
    if (/* some condition */) {
        return { path: args.path, external: true, cachable: true };
    }

    return { path: args.path, cachable: true };
});
  1. The exclude option could be a way around the missing lookahead feature of go-regex. To stamp out imports we don't want to look at
  2. The opt-in cachable: true could tell esbuild to not ask for the same information again, which would be nice for watcher performance

Would you be open to this idea and if yes, would you appreciate a PR contribution?

@sod
Copy link
Contributor Author

sod commented Feb 24, 2024

Maybe the cachable is a bit much. But the exclude option could go a long way.

sod added a commit to sod/esbuild that referenced this issue Feb 24, 2024
sod added a commit to sod/esbuild that referenced this issue Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant