在newContext内的 context.configure 方法中, 对配置文件进行初始化。 

//Merge shim
                if (cfg.shim) {
                    eachProp(cfg.shim, function (value, id) {
                        //shim 为数组类型, 很少用。
                        //一般为 对象类型
                        //Normalize the structure
                        if (isArray(value)) {
                            value = {
                                deps: value
                            };
                        }
                       
                        // 当前配置点有exports或 init.
                        // 没有初始化过exportsFn时
                        // 进行初始化
                        if ((value.exports || value.init) && !value.exportsFn) {
                            value.exportsFn = context.makeShimExports(value);
                        }
                        shim[id] = value;
                    });
                    config.shim = shim;
                }

相关文章:

  • 2022-12-23
  • 2021-06-30
  • 2021-11-17
  • 2021-08-01
  • 2018-05-30
  • 2021-12-15
  • 2022-01-15
  • 2022-12-23
猜你喜欢
  • 2021-09-22
  • 2021-11-08
  • 2021-08-20
  • 2022-12-23
  • 2021-11-19
  • 2021-12-29
相关资源
相似解决方案