Skip to content

Commit f5c1224

Browse files
authoredAug 1, 2023
perf: replace startsWith with === (#14005)
1 parent 8272ef5 commit f5c1224

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎packages/vite/src/node/plugins/importAnalysisBuild.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin {
183183
? // If `experimental.renderBuiltUrl` or `build.modulePreload.resolveDependencies` are used
184184
// the dependencies are already resolved. To avoid the need for `new URL(dep, import.meta.url)`
185185
// a helper `__vitePreloadRelativeDep` is used to resolve from relative paths which can be minimized.
186-
`function(dep, importerUrl) { return dep.startsWith('.') ? new URL(dep, importerUrl).href : dep }`
186+
`function(dep, importerUrl) { return dep[0] === '.' ? new URL(dep, importerUrl).href : dep }`
187187
: optimizeModulePreloadRelativePaths
188188
? // If there isn't custom resolvers affecting the deps list, deps in the list are relative
189189
// to the current chunk and are resolved to absolute URL by the __vitePreload helper itself.

0 commit comments

Comments
 (0)
Please sign in to comment.