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

perf: reduce preload marker markup size #14550

Merged
merged 15 commits into from
Oct 10, 2023
Prev Previous commit
refactor: avoid unnecessary ternary
  • Loading branch information
gajus committed Oct 9, 2023
commit b1f939e34c5f7997782df1e67a67913a57800df9
9 changes: 5 additions & 4 deletions packages/vite/src/node/plugins/importAnalysisBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -579,10 +579,11 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin {
const cssDeps: number[] = []
const otherDeps: number[] = []
for (const dep of depsArray) {
;(getFileDep(dep).url.endsWith('.css')
? cssDeps
: otherDeps
).push(dep)
if (getFileDep(dep).url.endsWith('.css')) {
cssDeps.push(dep)
} else {
otherDeps.push(dep)
}
}
resolvedDeps = [
...resolveDependencies(
Expand Down