Skip to content

Commit 97c58bf

Browse files
committed
[babel-plugin] Ensure import path is always relative.
1 parent 8117adc commit 97c58bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/babel-plugin-relay/createModernNode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
'use strict';
1313

1414
const crypto = require('crypto');
15-
const fs = require('fs');
1615
const path = require('path');
1716

1817
const {print} = require('graphql');
@@ -131,7 +130,8 @@ function getRelativeImportPath(
131130
path.resolve(artifactDirectory),
132131
);
133132

134-
const relativeReference = relative.length === 0 ? './' : '';
133+
const relativeReference =
134+
relative.length === 0 || !relative.startsWith('.') ? './' : '';
135135

136136
return relativeReference + path.join(relative, fileToRequire);
137137
}

0 commit comments

Comments
 (0)