From 18f0fb4e3989192ba95a397476371a945bf84542 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Wed, 12 Oct 2022 22:34:41 +0530 Subject: [PATCH] revert: "fix(build): remove leading underscore from chunks" (#1471) This reverts commit 66cd1640d16170e0c2d9eb4565ad1ebe81f940e1. --- src/node/build/bundle.ts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/node/build/bundle.ts b/src/node/build/bundle.ts index 1d3fb56612a..1ec51b3707c 100644 --- a/src/node/build/bundle.ts +++ b/src/node/build/bundle.ts @@ -68,7 +68,6 @@ export async function bundle( // other preserveEntrySignatures: 'allow-extension', output: { - sanitizeFileName, ...rollupOptions?.output, ...(ssr ? { @@ -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(/^_+/, '') - ) -}