Heuristic to determine file name vs. node module for extensions
The readme for user-require-helper describes the heuristic to distinguish a module name from a filename:
If the request argument has a file extension, it’s resolved as a path.
After upgrading to Antora 3.0.0-alpha.8, I got an error for a previously working Asciidoctor extension with the module name asciidoctor-highlight.js
. This module name contains a dot, therefore this helper treats it as a file name that doesn't exist.
NPM module names sometimes contain a dot (highlight.js
is an existing module name as well).
I wonder if
- this helper could instead try the file name first, and if that doesn't exist use the module name in a second try, or
- the docs should mention on https://docs.antora.org/antora/3.0/playbook/asciidoc-extensions/ something like "If the name-of-node-module contains a dot, please append a '/' so that Antora doesn't assume that it is a file name'