refactor: file hashes use url-safe base64 encoded hashes in vite 5 (rollup 4)

This commit is contained in:
alex8088 2023-12-11 21:59:31 +08:00
parent dc87a798ab
commit 93763597fe
2 changed files with 2 additions and 2 deletions

View file

@ -42,7 +42,7 @@ function resolveAsset(id: string): AssetResolved | null {
return null return null
} }
const nodeAssetRE = /__VITE_NODE_ASSET__([a-z\d]{8})__/g const nodeAssetRE = /__VITE_NODE_ASSET__([\w$]+)__/g
const nodePublicAssetRE = /__VITE_NODE_PUBLIC_ASSET__([a-z\d]{8})__/g const nodePublicAssetRE = /__VITE_NODE_PUBLIC_ASSET__([a-z\d]{8})__/g
const wasmHelperId = '\0__electron-vite-wasm-helper' const wasmHelperId = '\0__electron-vite-wasm-helper'

View file

@ -3,7 +3,7 @@ import type { SourceMapInput } from 'rollup'
import MagicString from 'magic-string' import MagicString from 'magic-string'
import { cleanUrl, parseRequest, toRelativePath } from '../utils' import { cleanUrl, parseRequest, toRelativePath } from '../utils'
const nodeWorkerAssetUrlRE = /__VITE_NODE_WORKER_ASSET__([a-z\d]{8})__/g const nodeWorkerAssetUrlRE = /__VITE_NODE_WORKER_ASSET__([\w$]+)__/g
/** /**
* Resolve `?nodeWorker` import and automatically generate `Worker` wrapper. * Resolve `?nodeWorker` import and automatically generate `Worker` wrapper.