From 331b9f6425abf450cfeb3aaa1094db3dce473dc0 Mon Sep 17 00:00:00 2001 From: Chuck Jazdzewski Date: Wed, 29 Mar 2017 09:34:21 -0700 Subject: [PATCH] fix(language-service): don't require `reflect-metadata` module to be provided (#15569) Fixes #15568 --- packages/language-service/rollup.config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/language-service/rollup.config.js b/packages/language-service/rollup.config.js index 834d91f0bc..336697a4f9 100644 --- a/packages/language-service/rollup.config.js +++ b/packages/language-service/rollup.config.js @@ -49,13 +49,15 @@ function resolve(id, from) { } var banner = ` +var $reflect = {defineMetadata: function() {}, getOwnMetadata: function(){}}; +((typeof global !== 'undefined' && global)||{})['Reflect'] = $reflect; var $deferred, $resolved, $provided; function $getModule(name) { return $provided[name] || require(name); } function define(modules, cb) { $deferred = { modules: modules, cb: cb }; } module.exports = function(provided) { if ($resolved) return $resolved; var result = {}; - $provided = Object.assign({}, provided || {}, { exports: result }); + $provided = Object.assign({'reflect-metadata': $reflect}, provided || {}, { exports: result }); $deferred.cb.apply(this, $deferred.modules.map($getModule)); $resolved = result; return result;