From 77094c55a7876f1c9cf79ef80e43af961cc8b662 Mon Sep 17 00:00:00 2001 From: Adam Shaw Date: Wed, 16 Dec 2020 21:18:33 -0500 Subject: [PATCH] fix locale dist files for IE11. fixes #6014 --- rollup.locales.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/rollup.locales.js b/rollup.locales.js index 1d1539d44a..80d93e1269 100644 --- a/rollup.locales.js +++ b/rollup.locales.js @@ -30,7 +30,8 @@ module.exports = [ }, plugins: [ externalizeRelative(), // resulting bundle will import the individual locales - sucraseInstance + sucraseInstance, + dumbDownFuncs() ] }, @@ -48,6 +49,7 @@ module.exports = [ }), plugins: [ sucraseInstance, + dumbDownFuncs(), bundleWrapLocalesAll() ] }, @@ -61,7 +63,8 @@ module.exports = [ file: path.join('packages/core/locales', path.basename(srcLocaleFile, '.ts') + '.js') }, plugins: [ - sucraseInstance + sucraseInstance, + dumbDownFuncs() ] })), @@ -79,6 +82,7 @@ module.exports = [ }), plugins: [ sucraseInstance, + dumbDownFuncs(), bundleWrapLocalesEach() ] })) @@ -102,3 +106,13 @@ function bundleWrapLocalesEach() { } } } + + +// for IE11: https://github.com/fullcalendar/fullcalendar/issues/6014 +function dumbDownFuncs() { + return { + renderChunk(code) { + return code.replace(/(\w+)(\([\w, ]\)\s*{)/g, '$1: function$2') + } + } +}