@@ -8,10 +8,10 @@ import isModule from 'is-module';
8
8
import { version } from '../package.json' ;
9
9
10
10
import { isDirCached , isFileCached , readCachedFile } from './cache' ;
11
+ import handleDeprecatedOptions from './deprecated-options' ;
11
12
import { fileExists , readFile , realpath } from './fs' ;
12
13
import resolveImportSpecifiers from './resolveImportSpecifiers' ;
13
14
import { getMainFields , getPackageName , normalizeInput } from './util' ;
14
- import handleDeprecatedOptions from './deprecated-options' ;
15
15
16
16
const builtins = new Set ( builtinList ) ;
17
17
const ES6_BROWSER_EMPTY = '\0node-resolve:empty.js' ;
@@ -225,11 +225,10 @@ export function nodeResolve(opts = {}) {
225
225
}
226
226
return null ;
227
227
}
228
- const result = {
228
+ return {
229
229
id : `${ location } ${ importSuffix } ` ,
230
230
moduleSideEffects : hasModuleSideEffects ( location )
231
231
} ;
232
- return result ;
233
232
} ;
234
233
235
234
return {
@@ -271,9 +270,13 @@ export function nodeResolve(opts = {}) {
271
270
importer ,
272
271
Object . assign ( { skipSelf : true } , resolveOptions )
273
272
) ;
274
- const isExternal = ! ! ( resolvedResolved && resolvedResolved . external ) ;
275
- if ( isExternal ) {
276
- return false ;
273
+ if ( resolvedResolved ) {
274
+ // Handle plugins that manually make the result external
275
+ if ( resolvedResolved . external ) {
276
+ return false ;
277
+ }
278
+ // Pass on meta information added by other plugins
279
+ return { ...resolved , meta : resolvedResolved . meta } ;
277
280
}
278
281
}
279
282
return resolved ;
0 commit comments