sourceTextModule.moduleRequests


新增于: v24.4.0, v22.20.0
  • 类型:ModuleRequest[] 此模块的依赖。

    \Type: ModuleRequest[] Dependencies of this module.

此模块请求的导入依赖。返回的数组被冻结,不允许对其进行任何更改。

\The requested import dependencies of this module. The returned array is frozen to disallow any changes to it.

例如,给定一个源文本:

\For example, given a source text:

import foo from 'foo';
import fooAlias from 'foo';
import bar from './bar.js';
import withAttrs from '../with-attrs.ts' with { arbitraryAttr: 'attr-val' };
import source Module from 'wasm-mod.wasm'; 

sourceTextModule.moduleRequests 的值将是:

\The value of the sourceTextModule.moduleRequests will be:

[
 {
 specifier: 'foo',
 attributes: {},
 phase: 'evaluation',
 },
 {
 specifier: 'foo',
 attributes: {},
 phase: 'evaluation',
 },
 {
 specifier: './bar.js',
 attributes: {},
 phase: 'evaluation',
 },
 {
 specifier: '../with-attrs.ts',
 attributes: { arbitraryAttr: 'attr-val' },
 phase: 'evaluation',
 },
 {
 specifier: 'wasm-mod.wasm',
 attributes: {},
 phase: 'source',
 },
]; 

AltStyle によって変換されたページ (->オリジナル) /