You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// NOTE: If request is a phantom dependency, which means it can be resolved but not specified in dependencies or peerDependencies in package.json, the output will be incorrect to use when the package is published
1491
1495
// return the original request instead of the resolved request
1492
-
returnundefined;
1496
+
return{
1497
+
path: undefined,
1498
+
isResolved: true,
1499
+
};
1493
1500
}catch(_e){
1494
1501
// catch error when request can not be resolved by resolver
1495
1502
// e.g. A react component library importing and using 'react' but while not defining
1496
1503
// it in devDependencies and peerDependencies. Preserve 'react' as-is if so.
1497
1504
logger.debug(
1498
1505
`Failed to resolve module ${color.green(`"${request}"`)} from ${color.green(issuer)}. If it's an npm package, consider adding it to dependencies or peerDependencies in package.json to make it externalized.`,
1499
1506
);
1500
-
returnrequest;
1507
+
// return origin request instead of undefined for cssExternalHandler
Whether to automatically redirect the file extension to import paths based on the TypeScript declaration output files.
272
+
Whether to automatically redirect the file extension of import paths based on the TypeScript declaration output files.
273
273
274
-
- When set to `true`, the import paths in declaration files will be redirected to the corresponding JavaScript extension which can be resolved to corresponding declaration file. The extension of the declaration output file is related to the `dtsExtension` configuration.
274
+
- When set to `true`, the file extension of the import path in the declaration file will be automatically completed or replaced with the corresponding JavaScript file extension that can be resolved to the corresponding declaration file. The extension of the declaration output file is related to the `dtsExtension` configuration.
275
275
276
276
```ts
277
277
// `dtsExtension` is set to `.d.mts`
@@ -282,7 +282,7 @@ import { foo } from './foo.ts'; // source code of './src/bar.ts' ↓
282
282
import { foo } from'./foo.mjs'; // expected output of './dist/bar.d.mts'
283
283
```
284
284
285
-
- When set to `false`, the file extension will remain unchanged from the original import path in the rewritten import path of the output file (regardless of whether it is specified or specified as any value).
285
+
- When set to `false`, import paths will retain their original file extensions.
0 commit comments