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 all commits
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
4 changes: 3 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,9 @@ const replaceExportDefault = template(`
const getFilename = state => {
const rootDir = get(state, 'opts.root', process.cwd())
const filename = get(state, 'file.opts.filename')
return filename && path.relative(rootDir, filename)
let filePath = filename && path.relative(process.cwd(), filename)
if (process.platform === 'win32') filePath = filePath.split('\\').join('/')
return filePath
}

const findPathToInsert = path =>
Expand Down