From 0da6ed2ef98445fb02e947b87157083a3f2f055a Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Thu, 4 Jun 2020 13:56:21 +0200
Subject: [PATCH] Give up on manual chunking

There still is no content based hashing and it interferes with dynamic imports
where most of the chunks get loaded before they are actualy imported.

Just remove it.
---
 rollup.config.js | 29 +----------------------------
 1 file changed, 1 insertion(+), 28 deletions(-)

diff --git a/rollup.config.js b/rollup.config.js
index efdc307..ad72506 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -39,7 +39,6 @@ let pdfAsQualifiedlySigningServer = '';
 let matomoSiteId = 131;
 let useTerser = true;
 let useBabel = true;
-let useManualChunks = true;
 let checkLicenses = !watch;
 
 switch (build) {
@@ -91,32 +90,6 @@ switch (build) {
     process.exit(1);
 }
 
-
-
-const CHUNK_BLACKLIST = [
-  'jszip',  // jszip is a node module by default and rollup chunking is confused by that and emits warnings
-  'source-sans-pro',
-  '@open-wc/scoped-elements', // produces no code
-];
-
-/**
- * Returns a list of chunks used for splitting up the bundle.
- * We recursively use every dependency and ever internal dev dependency (starting with 'vpu-').
- */
-function getManualChunks(pkg) {
-  let manualChunks = Object.keys(pkg.dependencies).reduce(function (acc, item) { acc[item] = [item]; return acc;}, {});
-  const vpu = Object.keys(pkg.devDependencies).reduce(function (acc, item) { if (item.startsWith('vpu-')) acc[item] = [item]; return acc;}, {});
-  for (const vpuName in vpu) {
-    const subPkg = require('./node_modules/' + vpuName + '/package.json');
-    manualChunks = Object.assign(manualChunks, getManualChunks(subPkg));
-  }
-  manualChunks = Object.assign(manualChunks, vpu);
-  for(const name of CHUNK_BLACKLIST) {
-    delete manualChunks[name];
-  }
-  return manualChunks;
-}
-
 /**
  * Creates a server certificate and caches it in the .cert directory
  */
@@ -173,8 +146,8 @@ export default {
       format: 'esm',
       sourcemap: true
     },
+    preserveEntrySignatures: false,
     // external: ['zlib', 'http', 'fs', 'https', 'url'],
-    manualChunks: useManualChunks ? getManualChunks(pkg) : false,
     onwarn: function (warning, warn) {
         // ignore "suggestions" warning re "use strict"
         if (warning.code === 'MODULE_LEVEL_DIRECTIVE') {
-- 
GitLab