简体   繁体   中英

How to get the relative file path of this file heirarchy in JS

Alpha

    c1
        source.js
    c2
        d
            e
                f
                    target

i want to get the relative path of target in the import statement of the source file

import '../c2/d/e/f/target';

../ stands for one directory up

./ stands for in the same directory

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM