Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

fix(babel-plugin-export-metadata): transform to Unix slash (#825) #829

Merged
merged 2 commits into from
Jul 11, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion other-packages/babel-plugin-export-metadata/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('/')
}
return filePath
}

const findPathToInsert = path =>
Expand Down