Skip to content

Commit 2eb6ed9

Browse files
committed
fix: use correct source file names relative to source dir for sourcemaps
1 parent c203294 commit 2eb6ed9

File tree

1 file changed

+3
-2
lines changed
  • packages/react-native-builder-bob/src/utils

1 file changed

+3
-2
lines changed

packages/react-native-builder-bob/src/utils/compile.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,12 @@ export default async function compile({
5454

5555
const content = await fs.readFile(filepath, 'utf-8');
5656
const result = await babel.transformAsync(content, {
57+
cwd: root,
5758
babelrc: babelrc,
5859
configFile: configFile,
5960
sourceMaps,
60-
sourceRoot: path.relative(output, source),
61+
sourceRoot: path.relative(path.dirname(outputFilename), source),
62+
sourceFileName: path.relative(source, filepath),
6163
filename: filepath,
6264
...(babelrc || configFile
6365
? null
@@ -66,7 +68,6 @@ export default async function compile({
6668
[
6769
require.resolve('@babel/preset-env'),
6870
{
69-
// @ts-ignore
7071
targets: browserslist.findConfig(root) ?? {
7172
browsers: [
7273
'>1%',

0 commit comments

Comments
 (0)