Skip to content

browserify applies transforms to npm linked modules #1386

@jayphelps

Description

@jayphelps

If you npm link a module into your browserify project, it incorrectly has transforms applied to it. This becomes a major issue particularly if the module you install relies on non-strict mode and you're using babelify, which inserts "use strict", causing it to error.

Here's a repo to reproduce: https://github.com/jayphelps/browserify-bug. The major step to note in the README is that you must git clone the external module and npm link it for the bug to show.

Also note that very new versions of babel proactively transform certain strict mode code, like this.foo to undefined.foo. Don't let this confuse you.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions