rslib icon indicating copy to clipboard operation
rslib copied to clipboard

[Feature]: in bundless, if cannot resolve, error message should be emitted

Open SoonIter opened this issue 1 year ago • 1 comments

          By the way, in bundless mode, if cannot resolve, error message should be emitted

Originally posted by @SoonIter in https://github.com/web-infra-dev/rslib/issues/250#issuecomment-2382455625

SoonIter avatar Sep 30 '24 08:09 SoonIter

if cannot resolve, error message should be emitted

In this case, it's because the resolved module is externalized, Rspack won't check if it's available anymore.

Yes, we need to ensure that the emitted files could be resolved. In this case, we overlooked the ⁠index mainFields, which makes this a fixable bug for us. Let's see if there are any paths that Rslib could not detect in the future. If so, we can add a post-check.

fi3ework avatar Sep 30 '24 08:09 fi3ework

getResolve in externals function related.

We can resolve every module when externalized and print a warning if cannot be resolved, but we should benchmark the performance of this.

Timeless0911 avatar Nov 28 '24 08:11 Timeless0911

https://github.com/web-infra-dev/rslib/blob/8a9f9e336a84a0c7359d5e7d5ad06e8699ea33e2/packages/core/src/config.ts#L1016-L1023

@SoonIter should we throw error/warning here if we cannot resolve in bundleless mode?

Timeless0911 avatar Dec 19 '24 05:12 Timeless0911

https://github.com/web-infra-dev/rslib/blob/8a9f9e336a84a0c7359d5e7d5ad06e8699ea33e2/packages/core/src/config.ts#L1016-L1023

@SoonIter should we throw error/warning here if we cannot resolve in bundleless mode?

let the bullet in the sky, users would feedback

SoonIter avatar Dec 19 '24 05:12 SoonIter

https://github.com/web-infra-dev/rslib/blob/6f11138094bb09cec6e056a930a572f2c8608dd1/packages/core/src/config.ts#L1085-L1093 Open a new issue if you want to feedback about this issue.

Timeless0911 avatar Jan 07 '25 08:01 Timeless0911