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

chore: tweak build config #18622

Merged
merged 1 commit into from
Nov 8, 2024
Merged

Conversation

sapphi-red
Copy link
Member

Description

@sapphi-red sapphi-red added the p1-chore Doesn't change code behavior (priority) label Nov 8, 2024
@@ -94,6 +94,7 @@ function createSharedNodePlugins({
// Since ws is not that perf critical for us, just ignore these deps.
ignore: ['bufferutil', 'utf-8-validate'],
sourceMap: false,
strictRequires: 'auto',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To get slightly smaller bundle.

format: 'cjs',
externalLiveBindings: false,
freeze: false,
sourcemap: false,
Copy link
Member Author

@sapphi-red sapphi-red Nov 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sourcemap is not set in sharedNodeOptions.output, but removed because the default value is false.

Comment on lines +301 to +302
if (!code.includes('__require')) return

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only inject __require if needed.

Comment on lines -21 to -22
// lightningcss types are bundled
...Object.keys(pkg.devDependencies).filter((d) => d !== 'lightningcss'),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has changed by #18460

@patak-dev patak-dev enabled auto-merge (squash) November 8, 2024 11:03
@patak-dev patak-dev merged commit 2a88f71 into vitejs:main Nov 8, 2024
16 checks passed
@sapphi-red sapphi-red deleted the chore/tweak-build-config branch November 8, 2024 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1-chore Doesn't change code behavior (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants