Closed cdpark0530 closed 2 years ago
I found that function getPathsToTry
in node_modules/tsconfig-paths/lib/try-path.js
didn't resolve the image module url("/images/pages/search/example.png")
. I close this issue as it's nothing to do with this plugin.
It was because it starts with /
which is Linux path separator. It can resolve the image module even on Linux when I commented the part like below.
var path = require("path");
...
function getPathsToTry(extensions, absolutePathMappings, requestedModule) {
if (!absolutePathMappings ||
!requestedModule ||
requestedModule[0] === "." /* ||
requestedModule[0] === path.sep */) {
return undefined;
}
...
}
I tracked down functions below as well, and I found nothing that makes the different resolution on Windows and Linux.
In node_modules/tsconfig-paths-webpack-plugin/lib/plugin.js
constructor
apply
createPluginCallback
, the returned function of it, and the callback passed to matchPath
in createPluginCallback
In node_modules/tsconfig-paths/lib/match-path-async.js
createMatchPathAsync
matchFromAbsolutePathsAsync
Before beginning, my Linux host is a docker container of image
node:latest
to be exactCurrent behaviour 💣
On Windows host, it resolves url in css files. On Linux host, it does not resolve url in css files.
Expected behaviour ☀️
On Linux host, it resolves url in css files as it does on Windows host.
or
as
resolve.alias
value (which is commented) of webpack.config.ts in this project: https://github.com/cdpark0530/tsconfig-paths-webpack-plugin-issue.gitReproduction Example 👾
I made a backbone example on my github: https://github.com/cdpark0530/tsconfig-paths-webpack-plugin-issue.git
Environment 🖥
Windows
Linux container
dependencies