Skip to content

✨ Detect undeclared dependencies in build output #100

Description

@djk01281

[🎨 Background]

  • @naverpay/pite can inject external helpers and polyfills into the build output: core-js-pure (via babel-plugin-polyfill-corejs3, usage-pure mode)

  • When injected, these must be declared in the library's dependencies so consumers can resolve them at runtime. If a library injects them but doesn't declare them, consumers hit MODULE_NOT_FOUND.

  • Example: @naverpay/hidash@1.0.0 injects require("core-js-pure/...") into 16 output files, but dependencies doesn't include core-js-pure.


[πŸ”§ Fix]

Add a phantomDepCheck option (severity: 'error' | 'warn' | 'off', default 'error').

  • After build, scans the output's import/require specifiers and checks each against the manifest's dependencies

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions