ERR_UNSUPPORTED_DIR_IMPORT
import
目录网址不受支持。取而代之的是 package.json
文件的 "exports"
字段中的 使用包的名称自引用包 和 定义自定义的子路径。
¥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