doc: update experimental loader hooks example code
It fix 2 issues in provided Loader hooks examples:
- Original
new URL(`${process.cwd()}/`, 'file://');
is not cross-platform, it gives wrong URL on windows - Based on
CHECK
in ModuleWrap::Resolve (node 12.9.1, https://github.com/nodejs/node/blob/v12.9.1/src/module_wrap.cc#L1132) the 2nd parameter should be astring
, not anURL
object
Checklist
-
documentation is changed or added -
commit message follows commit guidelines