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
Create a webpack bundle that import react-router-dom
Expected Behavior
Only the main or es folder of the history library is bundled
Actual Behavior
Both the main and es folder of the history library is bundled
Theory
I believe that the issue stems from the fact that there are two different ways that things are being imported from history:
Deep imports like require('history/createBrowserHistory')
Direct imports like require('history')
The former type of import is bringing in JS modules in the root of node_modules/history, but the latter type is causing node_modules/es/index.js and its dependencies to be brought in due to the "main" entry point in its package.json.
In theory changing the imports to be consistent will avoid bundling all the files in both node_modules/history and node_modules/history/es.
The text was updated successfully, but these errors were encountered:
Version
[email protected]
Steps to reproduce
Create a webpack bundle that import
react-router-dom
Expected Behavior
Only the main or
es
folder of thehistory
library is bundledActual Behavior
Both the main and
es
folder of thehistory
library is bundledTheory
I believe that the issue stems from the fact that there are two different ways that things are being imported from history:
require('history/createBrowserHistory')
require('history')
The former type of import is bringing in JS modules in the root of
node_modules/history
, but the latter type is causingnode_modules/es/index.js
and its dependencies to be brought in due to the"main"
entry point in its package.json.In theory changing the imports to be consistent will avoid bundling all the files in both
node_modules/history
andnode_modules/history/es
.The text was updated successfully, but these errors were encountered: