-
-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support emitting asset with custom asset info #3837
Conversation
在传入提供的info对象的时候,这个info对象会出现在对应的asset的stats info中。 我的问题:
@h-a-n-a Thanks! |
This pull request has been automatically marked as stale because it has not had recent activity. If this pull request is still relevant, please leave any comment (for example, "bump"). |
Any news about this? |
Sorry, I think I am going to finish the left two TODOs very soon :) |
This pull request has been automatically marked as stale because it has not had recent activity. If this pull request is still relevant, please leave any comment (for example, "bump"). |
@suica are you interested in working on this? |
Sorry for not being able to follow up on this one. It's moved to the new PR #6721. Thank you for the contribution! |
WIP
draft for #3701
Summary
This PR allows users to emit asset with custom asset info.
TODOs (for personal tracking of progress):
emitAsset
in binding file.emit_asset
signature, atcrates/node_binding/src/js_values/compilation.rs
.emit_asset
, atcrates/rspack_core/src/compiler/compilation.rs
.all_map
into theAssetInfo
&JsAssetInfo
type, to show that we can accept info that users give.JsAssetInfo
or just use typeAssetInfoMap
instead.AssetInfoMap
type in generation of binding file.export type AssetInfo = Partial<JsAssetInfo> & Record<string, any>;
atpackages/rspack/src/compilation.ts
.type AssetInfo = KnownAssetInfo & Record<string, any>;
atnode_modules/webpack/types.d.ts
.JsStatsAsset
. Make sure we can emit the custom info object into the stats.JsAssetInfo
.updateAsset
atcrates/node_binding/src/js_values/compilation.rs
.Notes
type of assets is suspicious:
export type Assets = Record<string, Source>;
. Whysource
?Clear dist before test. Otherwise old main.js will lead to a failed case.
Cannot compile
Already reported this to Brooklyn and will be fixed.
Test Plan
TBA