To reproduce, create two files - /scripts/lib.js & /scripts/index.js, with index.js requiring libs.js
Then run the following from the root directory:
browserify -r ./scripts/lib.js > ./scripts/lib-bundle.js
browserify -x ./scripts/lib.js ./scripts/index.js > ./scripts/index-bundle.js
Then load in a browser:
<script src="/scripts/lib-bundle.js"></script>
<script src="/scripts/index-bundle.js"></script>
...and we get the following error: Uncaught Error: Cannot find module '/scripts\lib.js'.
Inspecting the output files, we see the following files are exporting/requiring the following paths:
| platform |
version |
lib-bundle.js exports |
index-bundle.js requires |
works |
| Windows |
>=12.0.2 |
/scripts/lib.js |
/scripts\\lib.js |
no |
| Windows |
<=12.0.1 |
/scripts\\lib.js |
/scripts\\lib.js |
yes |
| Linux |
any |
/scripts/lib.js |
/scripts/lib.js |
yes |
To reproduce, create two files -
/scripts/lib.js&/scripts/index.js, withindex.jsrequiringlibs.jsThen run the following from the root directory:
Then load in a browser:
...and we get the following error:
Uncaught Error: Cannot find module '/scripts\lib.js'.Inspecting the output files, we see the following files are exporting/requiring the following paths:
/scripts/lib.js/scripts\\lib.js/scripts\\lib.js/scripts\\lib.js/scripts/lib.js/scripts/lib.js