ERR_UNSUPPORTED_DIR_IMPORT
import 目录网址不受支持。
而是,在 package.json 文件的 "exports" 字段中,使用其名称自引用包和定义自定义的子路径。
import './'; // 不支持的
import './index.js'; // 支持的
import 'package-name'; // 支持的import a directory URL is unsupported. Instead,
self-reference a package using its name and define a custom subpath in
the "exports" field of the package.json file.
import './'; // unsupported
import './index.js'; // supported
import 'package-name'; // supported