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

fix(deps): update all non-major dependencies #15803

Merged
merged 4 commits into from
Feb 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: bump bundle size
magic-string and dotenv introduced more code
  • Loading branch information
bluwy committed Feb 8, 2024
commit d55b0eabe55ef073182e35629b784e744bcdfffb
12 changes: 8 additions & 4 deletions packages/vite/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function createCjsConfig(isProduction: boolean) {
...Object.keys(pkg.dependencies),
...(isProduction ? [] : Object.keys(pkg.devDependencies)),
],
plugins: [...createNodePlugins(false, false, false), bundleSizeLimit(163)],
plugins: [...createNodePlugins(false, false, false), bundleSizeLimit(165)],
})
}

Expand Down Expand Up @@ -327,18 +327,22 @@ const __require = require;
* @param limit size in kB
*/
function bundleSizeLimit(limit: number): Plugin {
let size = 0

return {
name: 'bundle-limit',
generateBundle(options, bundle) {
const size = Buffer.byteLength(
generateBundle(_, bundle) {
size = Buffer.byteLength(
Object.values(bundle)
.map((i) => ('code' in i ? i.code : ''))
.join(''),
'utf-8',
)
},
closeBundle() {
const kb = size / 1000
if (kb > limit) {
throw new Error(
this.error(
`Bundle size exceeded ${limit} kB, current size is ${kb.toFixed(
2,
)}kb.`,
Expand Down
Loading