Skip to content
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

Ability to name chunks #2

Open
hamdiwanis opened this issue Oct 13, 2021 · 2 comments
Open

Ability to name chunks #2

hamdiwanis opened this issue Oct 13, 2021 · 2 comments

Comments

@hamdiwanis
Copy link

First of all thanks for the great lib.

I was wondering if there is a way to name chunks the same way webpack do?

@zq0904
Copy link
Collaborator

zq0904 commented Nov 8, 2021

First of all, thank you for asking

At present, there is no configuration or support for this function, and it will not be supported in the short term (sorry to be a little busy), but the implementation is not very complicated, welcome PR.

Some feasible technical implementation schemes:

  1. Obtain the name of the annotation or directly use the name of the loading chunk
    1.1 get the comment name: metor customSerializer graph reference:graph.dependencies.get('xxx').getSource()
    1.2 or directly use the name of the chunk to load: Reference val.modules

    const { code } = mcs.bundleToString({ pre: '', post: '', modules: val.modules })

  2. Export chunk: reference

    const dir = path.resolve(mcs.outputChunkDir, `${hash}${output.fileSuffix}`)

  3. Make sure chunk loads as scheduled:
    3.1 the reference

    chunkModuleIdToHashMap[chunkId]['hash'] + '<%= options.fileSuffix %>'

    3.2 or use asyncRequireTpl for customization
    asyncRequireTpl: require.resolve('./tpl/wrapAsyncRequire.ejs'),

@krmao
Copy link

krmao commented Sep 29, 2022

hi , thanks for the greate lib,
please how to rename/special output dll/buz bundle name?, such as common.android.bundle, business-a.android.bundle @zq0904

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants