diff --git a/rollup.config.js b/rollup.config.js index efdc3079305bf05dfd47a8772d124df1e528cf51..ad725069b104e2dfad92e2379f97f755ae2c3832 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') {