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
Copy file name to clipboardExpand all lines: src/options.rs
+17-2Lines changed: 17 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -150,9 +150,24 @@ pub struct ResolveOptions {
150
150
/// Default `[]`
151
151
pubroots:Vec<PathBuf>,
152
152
153
-
/// Whether to resolve symlinks to their symlinked location.
153
+
/// Whether to resolve symlinks to their symlinked location, if possible.
154
154
/// When enabled, symlinked resources are resolved to their real path, not their symlinked location.
155
-
/// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link).
155
+
/// Note that this may cause module resolution to fail when using tools that symlink packages (like `npm link`).
156
+
///
157
+
/// Even if this option has been enabled, the resolver may decide not to follow the symlinks if the target cannot be
158
+
/// represented as a valid path for `require` or `import` statements in NodeJS. Specifically, we won't follow the symlink if:
159
+
/// 1. On Windows, the symlink is a [Volume mount point](https://learn.microsoft.com/en-us/windows/win32/fileio/volume-mount-points)
160
+
/// to a Volume that does not have a drive letter.
161
+
/// See: How to [mount a drive in a folder](https://learn.microsoft.com/en-us/windows-server/storage/disk-management/assign-a-mount-point-folder-path-to-a-drive).
162
+
/// 2. On Windows, the symlink points to a [DOS device path](https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#dos-device-paths)
163
+
/// that cannot be reduced into a [traditional DOS path](https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#traditional-dos-paths).
164
+
/// For example, all of the following symlink targets _will not_ be followed:
Copy file name to clipboardExpand all lines: src/windows.rs
+11-6Lines changed: 11 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -4,16 +4,18 @@ use crate::ResolveError;
4
4
5
5
/// When applicable, converts a [DOS device path](https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#dos-device-paths)
6
6
/// to a normal path (usually, "Traditional DOS paths" or "UNC path") that can be consumed by the `import`/`require` syntax of Node.js.
7
-
/// Returns `None` if the path cannot be represented as a normal path.
0 commit comments