diff --git a/client/src/client/workers/test-evaluator.js b/client/src/client/workers/test-evaluator.js index 6ed8430833..ecf090431f 100644 --- a/client/src/client/workers/test-evaluator.js +++ b/client/src/client/workers/test-evaluator.js @@ -1,5 +1,8 @@ /* global chai, importScripts */ -importScripts('https://cdnjs.cloudflare.com/ajax/libs/chai/4.2.0/chai.min.js'); +importScripts( + 'https://cdnjs.cloudflare.com/ajax/libs/chai/4.2.0/chai.min.js', + 'https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.0.0/polyfill.min.js' +); const oldLog = self.console.log.bind(self.console); self.console.log = function proxyConsole(...args) { diff --git a/client/src/templates/Challenges/rechallenge/builders.js b/client/src/templates/Challenges/rechallenge/builders.js index 9adb1ec881..037fb2c66b 100644 --- a/client/src/templates/Challenges/rechallenge/builders.js +++ b/client/src/templates/Challenges/rechallenge/builders.js @@ -63,8 +63,8 @@ export const cssToHtml = cond([ // ) => Observable[{ build: String, sources: Dictionary }] export function concatHtml(required, template, files) { const createBody = template ? _template(template) : defaultTemplate; - const sourceMap = Promise.all(files).then( - files => files.reduce((sources, file) => { + const sourceMap = Promise.all(files).then(files => + files.reduce((sources, file) => { sources[file.name] = file.source || file.contents; return sources; }, {}) @@ -101,13 +101,18 @@ A required file can not have both a src and a link: src = ${src}, link = ${link} .map(source => createBody({ source })) ); + /* eslint-disable max-len */ + const babelPolyfillCDN = + 'https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.0.0/polyfill.min.js'; + const babelPolyfill = ``; + /* eslint-enable max-len */ const frameRunner = ''; return from( - Promise.all([head, body, frameRunner, sourceMap]).then( - ([head, body, frameRunner, sourceMap]) => ({ - build: head + body + frameRunner, + Promise.all([head, body, babelPolyfill, frameRunner, sourceMap]).then( + ([head, body, babelPolyfill, frameRunner, sourceMap]) => ({ + build: head + body + babelPolyfill + frameRunner, sources: sourceMap }) ) diff --git a/client/src/templates/Challenges/utils/build.js b/client/src/templates/Challenges/utils/build.js index 5aca859fb3..996833ab0f 100644 --- a/client/src/templates/Challenges/utils/build.js +++ b/client/src/templates/Challenges/utils/build.js @@ -15,7 +15,7 @@ import { isPromise } from './polyvinyl'; const jQueryCDN = 'https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js'; -const jQuery = ``; +const jQuery = ``; const frameRunner = "";