Closed sandinmyjoints closed 9 years ago
Possibly related to https://github.com/thlorenz/browserify-shim/issues/121.
I can confirm this issue. I just tried to split up a large bundle into two files, vendor.js (3rd-party-stuff) and main.js (custom stuff), trying to use the commands:
browserify -r 3rdparty-nonshimmed -r 3rdparty-shimmed vendor.js -o vendor.pack.js
browserify -x 3rdparty-nonshimmed -x 3rdparty-shimmed main.js -o main.pack.js
vendor.js being an empty file, and main.js with sth. like:
var lib = require('3rdparty-nonshimmed');
var shimlib = require('3rdparty-shimmed');
console.log(lib, shimlib);
I get the same error as in @sandinmyjoints provided repo:
Error: Cannot find module '3rdparty-shimmed' from '...'
I tried with -t browserify-shim
as well, even though this should be handled through the package.json config, no help as well.
There's too much going on in #121 for me to parse. But this is the exact same issue as #152. I looked pretty thoroughly into that this morning and confirmed that b-shim isn't being called in that scenario.
Minimal repro: https://github.com/sandinmyjoints/browserify-shim-repro
npm run bundle:norequire
works.npm run bundle:require
does not, but it'd be awesome if it did. Is it possible?