Skip to content

ngx-build-plus should set webpack config output.asyncChunks to false when singleBundle is true #413

@sroucheray

Description

@sroucheray

When an application dynamically import an external library (e.g. await import('marked)), webpack will automatically produce a chunk. Setting singleBundle to true has no effect on those kinds of chunks. To disable the creation of those chunks and creating a true single bundle we must set output.asyncChunks to false in the webpack configuration (the documentation on these is not that verbose unfortunately https://webpack.js.org/configuration/output/#outputasyncchunks).

For now, on some project I own, I use the extraWebpackConfig to set it from an external webpack.config.js file, but I think the behavior should be included directly in ngx-build-plus. I am willing to provide a PR if you agree. Let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions