vitejs / vite-plugin-react

The all-in-one Vite plugin for React projects.
MIT License
546 stars 102 forks source link

feat: support including files in node_modules #306

Open Jinjiang opened 2 months ago

Jinjiang commented 2 months ago

Description

User can't customize exclude option to support hmr for files inside node_modules.

Additional context

304

With this PR, the reproduction can be fixed by Vite config:

plugins: [react({
  include: [/\.[tj]sx?$/, /\.[mc]js$/],
  exclude: [/\/node_modules\/(?!foo\/)/],
})],

What is the purpose of this pull request?

Before submitting the PR, please make sure you do the following