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

modularize_imports issue for re-export from node_modules #40347

Open
1 task done
tianyingchun opened this issue Sep 8, 2022 · 1 comment
Open
1 task done

modularize_imports issue for re-export from node_modules #40347

tianyingchun opened this issue Sep 8, 2022 · 1 comment
Labels
bug Issue was opened via the bug report template. SWC Related to minification/transpilation in Next.js.

Comments

@tianyingchun
Copy link

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

mac os/next 12.2.5

What browser are you using? (if relevant)

chrome

How are you deploying your application? (if relevant)

No response

Describe the Bug

next 12.2.5 follow this feature. #38583
mostly this feature works fine, except another sense has an issue here

for example

     '@mui/material': {
        transform: '@mui/material/{{member}}',
        preventFullImport: true,
      },

consider below sense:

  1. import {alpha} from @mui/material
  2. the alpha is re-exported from @mui/material
export {
 alpha
} from '@mui/system';
  1. in fact the alpha is really existed in @mui/system
  2. but in the next it will transform to @mui/material/alpha, this is wrong, it should ignore @mui/material/alpha because we won't configure the modularizeImports

Expected Behavior

in fact the alpha is really existed in @mui/system
but in the next it will transform to @mui/material/alpha, this is wrong, it should ignore @mui/material/alpha because we won't configure the modularizeImports

Link to reproduction

https://github.com/tianyingchun/next-issue

To Reproduce

  1. yarn
  2. yarn dev
  3. see console
  4. related feature: feat(next-swc/modularize_imports): Add Kebab case #38583

image

@tianyingchun tianyingchun added the bug Issue was opened via the bug report template. label Sep 8, 2022
@balazsorban44 balazsorban44 added area: experimental SWC Related to minification/transpilation in Next.js. labels Sep 8, 2022
@dsiebes
Copy link

dsiebes commented Jun 7, 2023

+1. This would be a very helpful for large projects based on MUI libraries or other large nested projects. Local dev can be quite a challenge given that we can not refactor all import statements or exports from dependencies. Thank you to anybody who takes a moment to look at this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. SWC Related to minification/transpilation in Next.js.
Projects
None yet
Development

No branches or pull requests

3 participants