-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
fix: Include src files in vite npm bundle (for sourcemaps) #3656
Conversation
I am leaning towards reverting #2843 directly instead of whitelisting only |
Also, I can add an |
Wait... one wants to have source maps and now someone else wants to exclude them? 😆 ... Yeah we should just revert the PR or just leave them as they are, because cause they any problems? 🤷
Which problems? Could you explain deeper? For debugging or so, IMO someone could just use |
Hi, I have details and a reproduction in the linked issue, #3652 TL;DR: when I download |
So IMO we should add these source files or revert the previous PR. |
I'd prefer to include |
Ok, I can do that, thanks for the feedback. |
0943800
to
13d8701
Compare
Maybe we want to exclude the |
Okay, then we are back to needing an |
13d8701
to
5b202be
Compare
Hmmmm, this isn't doing what I expect when I try |
OK, it seems that using main▶ npm pack --dry-run This branch▶ npm pack --dry-run |
8c44b96
to
cef3c9a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I like they way of just exclude everything and the use whitelist via .npmignore
First time seeing this workaround to using files
👍
|
I don't think it's possible to negate a pattern in |
It is possible:
I just tested with
|
Starting |
See discussions at <vitejs#3656 (comment)>
But then I have re-included all of |
So it's the same as |
I didn't realize files could be excluded in that way. I'm happy to open another PR if you'd prefer. |
😅 I've just opened a new one #3694 |
See discussions at <#3656 (comment)>
Description
Fixes #3652
Bundling sourcemaps without the source causes problems, so this adds the source files to the npm bundle.
Sourcemaps were introduced in #2843.
Additional context
I wanted to try adding a conditional to the sourcemap config to only bundle them if NODE_ENV !== "production", but NODE_ENV is not set during yarn build or yarn release, so it has no effect.
Also,
.npmignore
files can be tricky and cause problems in some cases, although it probably could have been used here.What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).