-
-
Notifications
You must be signed in to change notification settings - Fork 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
[docs] add JSDocs for Vite build process #5517
Conversation
|
packages/kit/src/vite/index.js
Outdated
for (const key of Object.keys(bundle)) { | ||
// collect asset and output chunks | ||
if (bundle[key].type === 'asset') { | ||
assets.push(/** @type {import('rollup').OutputAsset} */ (bundle[key])); | ||
} else { | ||
chunks.push(/** @type {import('rollup').OutputChunk} */ (bundle[key])); | ||
} | ||
} |
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.
The key isn't used directly, might as well refactor it to Object.values while we're here.
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.
Yep, we can also leverage TS control flow for discriminated unions and remove the type assertion.
I merged this into |
Also refactored out a couple of methods to make
writeBundle
a little shorter and moved a few log statements to better align with code boundaries