Skip to content

Removed browser field dep breaks cached build #6

@calvinwiebe

Description

@calvinwiebe

Observed in benbria/loop and in a verification test: If there is a module listed in the browser field of package.json, and the file that field points to changes, and the original file is removed, the build will break with something like:

Error: ENOENT, open '/Users/calvinwiebe/dev/uber-test/foo.js'

For instance:
package.json:

browser: {'foo': './foo.js'}

Build and save cache.
Remove ./foo.js and point browser field to a different file. Such as:

browser: {'foo': './inner/foo.js'}

There will be something in the cache like this:

"deps":{"foo":"/Users/calvinwiebe/dev/uber-test/foo.js"}

And everything will die.

Removing a normal require path and file will update the cache accordingly. The solution to this might be a bit involved, as we'd need to walk up the dependency tree.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions