mirror of https://github.com/lukechilds/rollup.git
Rich Harris
8 years ago
committed by
GitHub
7 changed files with 15 additions and 11 deletions
@ -1,4 +1,6 @@ |
|||
import { isAbsolute, relative } from './path.js'; |
|||
|
|||
export default function relativeId ( id ) { |
|||
if ( typeof process === 'undefined' ) return id; |
|||
return id.replace( process.cwd(), '' ).replace( /^[\/\\]/, '' ); |
|||
if ( typeof process === 'undefined' || !isAbsolute( id ) ) return id; |
|||
return relative( process.cwd(), id ); |
|||
} |
|||
|
Loading…
Reference in new issue