Skip to content

Commit 93f3220

Browse files
committed
build(replay): Ensure replay module build has correct relative path
1 parent 87caa5b commit 93f3220

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/replay/rollup.npm.config.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import path from 'path';
2+
13
import replace from '@rollup/plugin-replace';
24

35
import { makeBaseNPMConfig, makeNPMConfigVariants } from '../../rollup/index';
@@ -8,7 +10,6 @@ export default makeNPMConfigVariants(
810
makeBaseNPMConfig({
911
hasBundles: true,
1012
packageSpecificConfig: {
11-
external: [...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.peerDependencies || {})],
1213
plugins: [
1314
// TODO: Remove this - replay version will be in sync w/ SDK version
1415
replace({
@@ -22,6 +23,12 @@ export default makeNPMConfigVariants(
2223
// set exports to 'named' or 'auto' so that rollup doesn't warn about
2324
// the default export in `worker/worker.js`
2425
exports: 'named',
26+
27+
// As we are inlining the rrweb dependency here, we need to ensure the nested folders are correct
28+
// Without this config, you get:
29+
// * build/npm/esm/node_modules/rrweb/...
30+
// * build/npm/esm/packages/replay/...
31+
preserveModulesRoot: path.join(process.cwd(), 'src'),
2532
},
2633
},
2734
}),

0 commit comments

Comments
 (0)