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
This breaks webpack bundling when using tsconfig-paths-webpack-plugin for modules that specify a "browser" field in their package.json.
I think this is because the plugin will find a path mapping match for (almost all) modules in <baseUrl>node_modules/*, but tsconfig-paths apparently only grabs the resolved path using the "main" filed package.json (source).
The expected behavior would be to respect Webpacks' module.mainFields used by the default resolver.
Our specific use case is a little unusual and I can probably find a way around it, but I figured I'd file a bug since this caused more than a fair bit of debugging to figure out. And I can imagine other use-cases where less unusual mappings would cause issues that are probably even more to trace back to the root cause described above.
The text was updated successfully, but these errors were encountered:
In our project we have a path mapping for
*
which explicitly maps tonode_modules
:This breaks webpack bundling when using
tsconfig-paths-webpack-plugin
for modules that specify a"browser"
field in their package.json.I think this is because the plugin will find a path mapping match for (almost all) modules in
<baseUrl>node_modules/*
, buttsconfig-paths
apparently only grabs the resolved path using the"main"
filed package.json (source).The expected behavior would be to respect Webpacks'
module.mainFields
used by the default resolver.Our specific use case is a little unusual and I can probably find a way around it, but I figured I'd file a bug since this caused more than a fair bit of debugging to figure out. And I can imagine other use-cases where less unusual mappings would cause issues that are probably even more to trace back to the root cause described above.
The text was updated successfully, but these errors were encountered: