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
We use the Webpack pipeline on Windows with sass-loader, postcss-loader, and css-loader. Then we found the generated source paths went crazy: F:\Projects\web-project-boilerplate\src\scss\index.scss just becomes F:/Projects/web-project-boilerplate/src/scss/F:/Projects/web-project-boilerplate/src/scss/F:/Projects/web-project-boilerplate/src/scss/index.scss.
As I followed the codebase in the pipeline, I noticed that the sass-loader use relative path, then the postcss-loader and css-loader turn to use absolute path for "sources" field in the sourceMap. In addition, the absolute path on Windows starts with a symbol of the disk driver, e.g. F: in our case. When it comes to sourceMap's util.join(), it only detects absolute path starts with /
Generally source maps operate on URLs, not file system paths. But it's unclear if tools like webpack will migrate or if the past of least resistance would be to allow on-the-fly conversions from file system paths in the API. Leaving open as a feature request for file system path support.
We use the Webpack pipeline on Windows with sass-loader, postcss-loader, and css-loader. Then we found the generated source paths went crazy:
F:\Projects\web-project-boilerplate\src\scss\index.scss
just becomesF:/Projects/web-project-boilerplate/src/scss/F:/Projects/web-project-boilerplate/src/scss/F:/Projects/web-project-boilerplate/src/scss/index.scss
.As I followed the codebase in the pipeline, I noticed that the sass-loader use relative path, then the postcss-loader and css-loader turn to use absolute path for "sources" field in the sourceMap. In addition, the absolute path on Windows starts with a symbol of the disk driver, e.g.
F:
in our case. When it comes to sourceMap'sutil.join()
, it only detects absolute path starts with/
source-map/lib/util.js
Line 228 in c3a8f5a
So it joins multiple paths across the loaders.
Also, the
util.isAbsolute
doesn't deal with the Windows absolute path as well.source-map/lib/util.js
Line 241 in c3a8f5a
Appendix:
Here is a case of how expressjs test the absolute path:
I'm not sure we need to handle the azure absolute path, but I would be better if we had window device path included.
Thanks
The text was updated successfully, but these errors were encountered: