UNPKG

gatsby-transformer-mdx

Version:
9 lines (7 loc) 259 B
const path = require('path'); const slash = require('slash'); module.exports = (from, to) => { if (!from) return to; const importPath = slash(path.relative(path.dirname(from), to)); return /\.\.\//.test(importPath) ? importPath : `./${importPath}`; };