Skip to content

Commit

Permalink
feat!: add extension to internal virtual modules (#14231)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red authored Sep 15, 2023
1 parent 64888b0 commit 9594c70
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/dynamicImportVars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
import { toAbsoluteGlob } from './importMetaGlob'
import { hasViteIgnoreRE } from './importAnalysis'

export const dynamicImportHelperId = '\0vite/dynamic-import-helper'
export const dynamicImportHelperId = '\0vite/dynamic-import-helper.js'

const relativePathRE = /^\.{1,2}\//
// fast path to check if source contains a dynamic import. we check for a
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/importAnalysisBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const preloadMethod = `__vitePreload`
export const preloadMarker = `__VITE_PRELOAD__`
export const preloadBaseMarker = `__VITE_PRELOAD_BASE__`

export const preloadHelperId = '\0vite/preload-helper'
export const preloadHelperId = '\0vite/preload-helper.js'
const preloadMarkerWithQuote = new RegExp(`['"]${preloadMarker}['"]`)

const dynamicImportPrefixRE = /import\s*\(/
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/modulePreloadPolyfill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Plugin } from '../plugin'
import { isModernFlag } from './importAnalysisBuild'

export const modulePreloadPolyfillId = 'vite/modulepreload-polyfill'
const resolvedModulePreloadPolyfillId = '\0' + modulePreloadPolyfillId
const resolvedModulePreloadPolyfillId = '\0' + modulePreloadPolyfillId + '.js'

export function modulePreloadPolyfillPlugin(config: ResolvedConfig): Plugin {
// `isModernFlag` is only available during build since it is resolved by `vite:build-import-analysis`
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/wasm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { ResolvedConfig } from '../config'
import type { Plugin } from '../plugin'
import { fileToUrl } from './asset'

const wasmHelperId = '\0vite/wasm-helper'
const wasmHelperId = '\0vite/wasm-helper.js'

const wasmHelper = async (opts = {}, url: string) => {
let result
Expand Down

0 comments on commit 9594c70

Please sign in to comment.