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

[bug]code splitting: module duplicated when dynamic import with and without chunkName comment #1680

Open
stormslowly opened this issue Nov 6, 2024 · 0 comments
Assignees

Comments

@stormslowly
Copy link
Member

stormslowly commented Nov 6, 2024

problem

// index.tsx
import Lazy1 from './proxy.tsx'
import Lazy2 from './proxy2.tsx'

console.log(Lazy1, Lazy2)
// proxy.tsx
import React from 'react';
export default React.lazy(async () => {
  return import(/*  makoChunkName: 'named' */ './lazy.tsx');
});
// proxy2.tsx
import React from 'react';
export default React.lazy(async () => {
  return import('./lazy.tsx');
});

the project will generate

$ ls  dist/*.js
dist/index.js
dist/lazy_tsx-async.js
dist/named-async.js

contents of dist/lazy_tsx-async.js and dist/named-async.js are almost the same; lazy.tsx module is duplcated

expect

lazy.tsx should not be duplicated.

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

2 participants