Skip to content

Commit

Permalink
chore: leave comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Apr 15, 2024
1 parent f2bce12 commit b446379
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/importAnalysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
url = wrapId(resolved.id)
}

// make the URL browser-valid
if (environment.options.injectInvalidationTimestamp) {
// make the URL browser-valid
// mark non-js/css imports with `?import`
if (isExplicitImportRequired(url)) {
url = injectQuery(url, 'import')
Expand Down
6 changes: 5 additions & 1 deletion packages/vite/src/node/server/transformRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,13 @@ async function handleModuleSoftInvalidation(
}

let result: TransformResult
// No transformation is needed if it's disabled manually
// This is primarily for backwards compatible SSR
if (!environment.options.injectInvalidationTimestamp) {
result = transformResult
} else {
}
// We need to transform each imports with new timestamps if available
else {
const source = transformResult.code
const s = new MagicString(source)
const imports = transformResult.ssr
Expand Down

0 comments on commit b446379

Please sign in to comment.