Skip to content

Commit 47a2b1d

Browse files
ajaymathurNoviny
authored andcommitted
update the extract react types loader to pull types from types file if present for external modules (#78)
1 parent ca961c0 commit 47a2b1d

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "releases": [{ "name": "extract-react-types-loader", "type": "patch" }], "dependents": [] }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Don't pull types from src if types file exits

packages/extract-react-types-loader/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ module.exports = function extractReactTypesLoader(content /* : string */) {
4747

4848
const resolveOpts = {
4949
pathFilter: (pkg, location, dist) => {
50-
if (pkg['atlaskit:src'] && location.includes('node_modules') && location.includes(pkg.main)) {
50+
if (
51+
!pkg.types &&
52+
pkg['atlaskit:src'] &&
53+
location.includes('node_modules') &&
54+
location.includes(pkg.main)
55+
) {
5156
return location.replace(dist, pkg['atlaskit:src']);
5257
}
5358
return null;

0 commit comments

Comments
 (0)