Skip to content

Commit

Permalink
fix locale dist files for IE11. fixes #6014
Browse files Browse the repository at this point in the history
  • Loading branch information
arshaw committed Dec 17, 2020
1 parent 78433cf commit 77094c5
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions rollup.locales.js
Expand Up @@ -30,7 +30,8 @@ module.exports = [
},
plugins: [
externalizeRelative(), // resulting bundle will import the individual locales
sucraseInstance
sucraseInstance,
dumbDownFuncs()
]
},

Expand All @@ -48,6 +49,7 @@ module.exports = [
}),
plugins: [
sucraseInstance,
dumbDownFuncs(),
bundleWrapLocalesAll()
]
},
Expand All @@ -61,7 +63,8 @@ module.exports = [
file: path.join('packages/core/locales', path.basename(srcLocaleFile, '.ts') + '.js')
},
plugins: [
sucraseInstance
sucraseInstance,
dumbDownFuncs()
]
})),

Expand All @@ -79,6 +82,7 @@ module.exports = [
}),
plugins: [
sucraseInstance,
dumbDownFuncs(),
bundleWrapLocalesEach()
]
}))
Expand All @@ -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')
}
}
}

0 comments on commit 77094c5

Please sign in to comment.