Skip to content

browserify vs bpkg #9

Description

@nodech

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');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions