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
Thanks for creating this library. The source code is well written and easy to understand.
I encountered an issue was that node resolution didn't work when the library is compiled to WASM since "path.canonicalize" is not available on that platform (see WebAssembly/wasi-filesystem#27).
To mitigate that I tried using the preserve_symlinks option to switch to the library's internal normalize_path function, but this option also didn't work for us because some paths are transformed incorrectly. For example, in node, path.normalize("../foo/bar/../baz") returns ../foo/baz -- but the internal normalize_path function in this library converts the same path into /foo/baz.
For the second issue, it could be possible to fix the function directly, but to resolve the first issue, I wonder if it would make sense to use a library like https://crates.io/crates/normpath instead of fs::canonicalize.
Is it possible to implement node module resolution without performing any path normalization / provide that as an option?
I'd be happy to try making a pull request if that was helpful. 🙂
The text was updated successfully, but these errors were encountered:
Thanks for creating this library. The source code is well written and easy to understand.
I encountered an issue was that node resolution didn't work when the library is compiled to WASM since "path.canonicalize" is not available on that platform (see WebAssembly/wasi-filesystem#27).
To mitigate that I tried using the
preserve_symlinks
option to switch to the library's internalnormalize_path
function, but this option also didn't work for us because some paths are transformed incorrectly. For example, in node,path.normalize("../foo/bar/../baz")
returns../foo/baz
-- but the internalnormalize_path
function in this library converts the same path into/foo/baz
.For the second issue, it could be possible to fix the function directly, but to resolve the first issue, I wonder if it would make sense to use a library like https://crates.io/crates/normpath instead of fs::canonicalize.Is it possible to implement node module resolution without performing any path normalization / provide that as an option?
I'd be happy to try making a pull request if that was helpful. 🙂
The text was updated successfully, but these errors were encountered: