File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change 1
1
const resolve = require ( 'resolve' ) ;
2
2
const path = require ( 'path' ) ;
3
3
4
- module . exports . interfaceVersion = 2 ;
5
-
6
4
function opts ( file , config ) {
7
5
return Object . assign (
8
6
{ extensions : [ '.ts' , '.tsx' ] } ,
9
7
config ,
10
8
// path.resolve will handle paths relative to CWD
11
- { basedir : path . dirname ( path . resolve ( file ) ) } ,
9
+ { basedir : path . dirname ( path . resolve ( file ) ) }
12
10
) ;
13
11
}
14
12
15
- module . exports . resolve = function ( source , file , config ) {
16
- if ( resolve . isCore ( source ) ) {
17
- return { found : true , path : null } ;
18
- }
13
+ module . exports = {
14
+ interfaceVersion : 2 ,
15
+ resolve : function ( source , file , config ) {
16
+ if ( resolve . isCore ( source ) ) {
17
+ return { found : true , path : null } ;
18
+ }
19
19
20
- try {
21
- return { found : true , path : resolve . sync ( source , opts ( file , config ) ) } ;
22
- } catch ( err ) {
23
- return { found : false } ;
24
- }
20
+ try {
21
+ return { found : true , path : resolve . sync ( source , opts ( file , config ) ) } ;
22
+ } catch ( err ) {
23
+ return { found : false } ;
24
+ }
25
+ } ,
25
26
} ;
You can’t perform that action at this time.
0 commit comments