mirror of https://github.com/lukechilds/rollup.git
Rich-Harris
8 years ago
1 changed files with 4 additions and 2 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