Skip to content

Commit 91c8f37

Browse files
authored
build: Do not exclude devDependencies from rollup build (#6358)
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.
1 parent cd0dd5a commit 91c8f37

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

rollup/npmHelpers.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ export function makeBaseNPMConfig(options = {}) {
9393
external: [
9494
...builtinModules,
9595
...Object.keys(packageDotJSON.dependencies || {}),
96-
...Object.keys(packageDotJSON.devDependencies || {}),
9796
...Object.keys(packageDotJSON.peerDependencies || {}),
9897
],
9998

0 commit comments

Comments
 (0)