web: create separate chunk for poly

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-03-20 22:33:06 +01:00
parent 43f19f78bb
commit d906738097
1 changed files with 4 additions and 0 deletions

View File

@ -23,6 +23,10 @@ const resources = [
const isProdBuild = process.env.NODE_ENV === "production";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
function manualChunks(id) {
if (id.includes("construct-style-sheets-polyfill")) {
// Keep polyfills in the main file so they are loaded when dependencies are loaded
return "vendor-poly";
}
if (id.includes("node_modules")) {
if (id.includes("codemirror")) {
return "vendor-cm";