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

export default will be change export #9591

Closed
7 tasks done
zjjjjjjjjjjd opened this issue Aug 9, 2022 · 5 comments
Closed
7 tasks done

export default will be change export #9591

zjjjjjjjjjjd opened this issue Aug 9, 2022 · 5 comments

Comments

@zjjjjjjjjjjd
Copy link

zjjjjjjjjjjd commented Aug 9, 2022

Describe the bug

This is code
image
This is after vite build
image
I can not find export default, because I use import HomeBanner from 'xxxxxxx'

Reproduction

https://stackblitz.com/edit/vitejs-vite-wxnmhh?file=main.js,counter.js,vite.config.js,es2%2Fcounter.js&terminal=dev

System Info

System:
    OS: macOS 12.5
    CPU: (8) x64 Apple M1 Pro
    Memory: 20.71 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 14.19.1 - /usr/local/bin/node
    Yarn: 1.22.18 - /usr/local/bin/yarn
    npm: 8.13.2 - /opt/homebrew/bin/npm
  Browsers:
    Firefox: 102.0.1
    Safari: 15.6

Used Package Manager

yarn

Logs

No response

Validations

@github-actions
Copy link

github-actions bot commented Aug 9, 2022

Hello @zjjjjjjjjjjd. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.

@zjjjjjjjjjjd
Copy link
Author

you are right , I added a reproduction

@sapphi-red
Copy link
Member

I don't find any problem with your reproduction.
You are exporting setupCounter as a named export in main.js so the output should be a named export.

@zjjjjjjjjjjd
Copy link
Author

I don't find any problem with your reproduction. You are exporting setupCounter as a named export in main.js so the output should be a named export.

emm, l want setupCounter can use 'default' export, like this
image
es2 folder is I need

@sapphi-red
Copy link
Member

I don't think chunks need to preserve the export if that isn't a entry chunk. (and this will be a rollup issue)
I think multiple entries is what you are looking for. #4530

@sapphi-red sapphi-red closed this as not planned Won't fix, can't repro, duplicate, stale Aug 11, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Aug 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants