Skip to content

Compiling code that uses library installed via npm link failes #117

@reverofevil

Description

@reverofevil

When doing a babelify transform after some previous transform on the sources that include some library via npm link, and if that library contains something like Object.keys, babelify makes build fail due to missing babel-runtime properties.

 watchify ... -t reactify -t [ babelify  --optional "runtime" ] ...

 Error: Cannot find module 'babel-runtime/core-js/object/keys' from '...\thrift\lib\nodejs\lib\thrift'

While if the library is reinstalled via npm install and it still contains Object.keys, it works OK.

The part of the message from ... doesn't point to an exact file, but to the whole library folder, and that doesn't seem like a correct behaviour also, because it takes time to look through all the sources of the library to find that Object.keys.

Also I don't understand why babelify even starts transforming that library, because default browserify behaviour for -t is to transform all the sources except libraries.

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