Skip to content

Commit

Permalink
fix(babel-plugin-export-metadata): transform to Unix slash (#825) (#829)
Browse files Browse the repository at this point in the history
transform Windows backslash to Unix slash
  • Loading branch information
fi3ework authored and pedronauck committed Jul 11, 2019
1 parent 502722a commit f823cc6
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit f823cc6

Please sign in to comment.