Skip to content

Conversation

@sod
Copy link
Contributor

@sod sod commented Feb 24, 2024

This allows plugins that are very broadly applied to user code, to ignore files and folders it knows not to touch, like node_modules, static files or shared folders.

As the cost of calling a plugin is not 0, especially onResolve hooks, this could help improve performance of plugins.

See #3666

used like:

const myPlugin = {
  name: 'my-plugin',
  setup(build) {
    build.onResolve({ filter: /.js$/, exclude: /^(static|my-lib)\// }, args => {
    })
    build.onLoad({ filter: /.js$/, exclude: /\/node_modules\// }, args => {
    })
  }
}

the exclude is optional and the filter-only syntax stil works.

@sod
Copy link
Contributor Author

sod commented May 2, 2024

@evanw whats your stance on this? Should I rebase, change something or drop? :)

@sod
Copy link
Contributor Author

sod commented Sep 4, 2024

I consider no response as a decline. For the sake of not cluttering esbuild PR tab, I close this.

@sod sod closed this Sep 4, 2024
@DamienCassou
Copy link

I would need such a feature.

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

Successfully merging this pull request may close these issues.

2 participants