Skip to content

Commit

Permalink
revert: "fix(build): remove leading underscore from chunks" (#1471)
Browse files Browse the repository at this point in the history
This reverts commit 66cd164.
  • Loading branch information
brc-dd committed Oct 12, 2022
1 parent 54cf6ce commit 18f0fb4
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/node/build/bundle.ts
Expand Up @@ -68,7 +68,6 @@ export async function bundle(
// other
preserveEntrySignatures: 'allow-extension',
output: {
sanitizeFileName,
...rollupOptions?.output,
...(ssr
? {
Expand Down Expand Up @@ -198,19 +197,3 @@ function staticImportedByEntry(
cache.set(id, someImporterIs)
return someImporterIs
}

// https://github.com/rollup/rollup/blob/69ff4181e701a0fe0026d0ba147f31bc86beffa8/src/utils/sanitizeFileName.ts

const INVALID_CHAR_REGEX = /[\x00-\x1F\x7F<>*#"{}|^[\]`;?:&=+$,]/g
const DRIVE_LETTER_REGEX = /^[a-z]:/i

function sanitizeFileName(name: string) {
const driveLetter = DRIVE_LETTER_REGEX.exec(name)?.[0] || ''
return (
driveLetter +
name
.substring(driveLetter.length)
.replace(INVALID_CHAR_REGEX, '_')
.replace(/^_+/, '')
)
}

0 comments on commit 18f0fb4

Please sign in to comment.