I noticed there's small difference with browserify vs bpkg backends.
bpkg correctly translate main using browser mappings where browserify
does not translate it using browser mappings.
command: ./node_modules/.bin/bmocha --open -m "$BMOCHA_CHROME" test/*-test.js
e.g.
package.json of the library being used.
{
"name": "test",
"main": "./lib/test.js",
"browser": {
"./lib/test": "./lib/test-browser.js"
}
}
This will fail(wont resolve to browser) with browserify backend:
const lib = require('test');
but following will work on both:
const lib = require('test/lib/test');
I noticed there's small difference with browserify vs bpkg backends.
bpkg correctly translate
mainusingbrowsermappings where browserifydoes not translate it using
browsermappings.command:
./node_modules/.bin/bmocha --open -m "$BMOCHA_CHROME" test/*-test.jse.g.
package.json of the library being used.
{ "name": "test", "main": "./lib/test.js", "browser": { "./lib/test": "./lib/test-browser.js" } }This will fail(wont resolve to browser) with
browserifybackend:but following will work on both: