比如
test.js 检测自身在 /aaaa/bbbb/text.js
就会加载 /aaaa/bbbb/example.js
test.js 检测自身在 /xxxx/text.js
就会加载 /xxxx/example.js
![]() |
1
acthtml 2018-09-05 10:01:42 +08:00 ![]() require('./example.js')即可。
|
![]() |
3
jy02534655 2018-09-05 10:09:01 +08:00 ![]() 楼主平时都是用绝对路径么?
|
![]() |
4
qiayue 2018-09-05 10:10:10 +08:00 ![]() 相对路径了解一下
|
![]() |
5
maichael 2018-09-05 10:10:24 +08:00 ![]() 相对路径了解一下。
|