Skip to content

✨ Detect undeclared dependencies in build output #100

@djk01281

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions