soupette dbfcfa211d Created custom plugin to switch from ee to ce at runtime
Signed-off-by: soupette <cyril.lpz@gmail.com>
2021-07-01 14:19:50 +02:00

18 lines
388 B
JavaScript

'use strict';
const path = require('path');
const { toPosixPath } = require('./utils');
module.exports = function mapToRelative(cwd, currentFile, module) {
let from = path.dirname(currentFile);
let to = path.normalize(module);
from = path.resolve(cwd, from);
to = path.resolve(cwd, to);
const moduleMapped = path.relative(from, to);
return toPosixPath(moduleMapped);
};