From 49338c2d62ecb7aa9cb68916dbb43605746e1b6d Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Thu, 1 Dec 2022 09:55:17 +0100 Subject: [PATCH] build: Do not exclude `devDependencies` from rollup build Currently, our rollup config adds all `dependencies`, `devDependencies` and `peerDependencies` to the `external` array, meaning they will not be inlined into the build. However, that makes it impossible to _selectively_ inline files. For example, in replay we'd like to inline `rrweb` into the bundle. What makes this even more tricky is that because of the nature of `deepmerge`, which we use to merge custom config into the default one, it is actually impossible to overwrite this, as a custom `external` array will not overwrite the default one, but be added to it. This change removes `devDependencies` from the externals. IMHO that is otherwise bound to break anyhow - as if the dependency is neither `dependency` nor `peerDependency`, and you import it (but not bundle it), stuff might break anyhow. --- rollup/npmHelpers.js | 1 - 1 file changed, 1 deletion(-) diff --git a/rollup/npmHelpers.js b/rollup/npmHelpers.js index e1657f7ef598..9bfbc8d338cc 100644 --- a/rollup/npmHelpers.js +++ b/rollup/npmHelpers.js @@ -93,7 +93,6 @@ export function makeBaseNPMConfig(options = {}) { external: [ ...builtinModules, ...Object.keys(packageDotJSON.dependencies || {}), - ...Object.keys(packageDotJSON.devDependencies || {}), ...Object.keys(packageDotJSON.peerDependencies || {}), ],