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

Hmr cyclic dependency #2466

Closed
anncwb opened this issue Mar 11, 2021 · 2 comments
Closed

Hmr cyclic dependency #2466

anncwb opened this issue Mar 11, 2021 · 2 comments

Comments

@anncwb
Copy link
Contributor

anncwb commented Mar 11, 2021

Is your feature request related to a problem? Please describe.
Same as this issue #2314.

Describe the solution you'd like

After the project is huge, circular dependencies will inevitably occur. This leads to some weird hot update problems. These problems may be impossible for others to troubleshoot, because there is no tool to check circular dependencies, but I did not find it. The tools found so far only check ts files, not vue files. Cycle Depends on vite1, and vue-cli seems to be allowed. At present, there is no solution to this hot update problem.

Describe alternatives you've considered

Is there a good way to solve the circular dependency, at least, until now I have not found

Additional context

@anncwb
Copy link
Contributor Author

anncwb commented Mar 16, 2021

At present, it can be solved by this simple plug-in writing method, but I don't know whether this writing method has other defects.

{
        name: 'singleHMR',
        handleHotUpdate({ modules, file }) {
          if (file.match(/xml$/)) return [];
          modules.map((m) => {
            m.importedModules = new Set()
            m.importers = new Set()
          });

          return modules;
        },
      },

@anncwb
Copy link
Contributor Author

anncwb commented Mar 16, 2021

@yyx990803 If you have time, can you help me answer it? thank you!

@anncwb anncwb closed this as completed Mar 21, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant