browserify icon indicating copy to clipboard operation
browserify copied to clipboard

`browserField: false` makes browserify ignore the transform option

Open chpio opened this issue 6 years ago • 1 comments

Hi,

if browserField: false (or implicitly node: true) is set, then the browserify.transform option of dependencies is ignored. In our case there is a

  "browserify": {
    "transform": [
      [
        "babelify"
      ]
    ]
  },

in some of our dependencie's package.json files, it's used to compile esm and jsx to cjs. I obliviously want to do that transformation when i bundle for node.

chpio avatar Mar 04 '19 15:03 chpio

Definitely a bug. The purpose of browserField: false, I would have thought, is to ignore the "browser" field in dependencies' package.json when resolving module entrypoints. This has nothing to do with whether or not we want to honour the "browserify.transform" field.

steve-taylor avatar Jun 20 '19 04:06 steve-taylor