解析用户条件
¥Resolving user conditions
运行 Node.js 时,可以使用 --conditions
标志添加自定义用户条件:
¥When running Node.js, custom user conditions can be added with the
--conditions
flag:
node --conditions=development index.js
然后将解析包导入和导出中的 "development"
条件,同时根据需要解析现有的 "node"
、"node-addons"
、"default"
、"import"
和 "require"
条件。
¥which would then resolve the "development"
condition in package imports and
exports, while resolving the existing "node"
, "node-addons"
, "default"
,
"import"
, and "require"
conditions as appropriate.
可以使用重复标志设置任意数量的自定义条件。
¥Any number of custom conditions can be set with repeat flags.