-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(gatsby-plugin-page-creator): replace parse-filepath polyfill wi…
…th native path.parse (#13122)
- Loading branch information
1 parent
6771f0f
commit 2178756
Showing
4 changed files
with
4 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
// @flow | ||
import parsePath from "parse-filepath" | ||
import path from "path" | ||
|
||
module.exports = (filePath: string): string => { | ||
const { dirname, name } = parsePath(filePath) | ||
const { dir, name } = path.parse(filePath) | ||
const parsedName = name === `index` ? `` : name | ||
|
||
return path.posix.join(`/`, dirname, parsedName, `/`) | ||
return path.posix.join(`/`, dir, parsedName, `/`) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters