forked from doczjs/docz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(babel-plugin-export-metadata): transform to Unix slash (doczjs#825)
transform Windows backslash to Unix slash
- Loading branch information
Showing
1 changed file
with
5 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,11 @@ const replaceExportDefault = template(` | |
|
||
const getFilename = state => { | ||
const filename = get(state, 'file.opts.filename') | ||
return filename && path.relative(process.cwd(), filename) | ||
let filePath = filename && path.relative(process.cwd(), filename) | ||
if (process.platform === 'win32') { | ||
filePath = filePath.split('\\').join('/') | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jesperorb
|
||
} | ||
return filePath | ||
} | ||
|
||
const findPathToInsert = path => | ||
|
path.normalize probably will do this thing?