mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Properly escape the dot character in regexp (#4608)
A follow-up to #4604: the dot in the regexp was not escaped as intended. By default `*` matches greedily, so the results are the same, but the new regexp should be more clear. Sorry for the mistake.
This commit is contained in:
parent
f2c2519159
commit
8889430777
|
@ -3,7 +3,7 @@ import { readdirSync, existsSync } from 'fs'
|
|||
|
||||
export function getChunkNameFromFilename (filename, dev) {
|
||||
if (dev) {
|
||||
return filename.replace(/.[^.]*$/, '')
|
||||
return filename.replace(/\.[^.]*$/, '')
|
||||
}
|
||||
return filename.replace(/-[^-]*$/, '')
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue