Skip to content

feat: allow the option filename to be a function #143

Closed
@berthertogen

Description

@berthertogen

Can we allow the filename and chunkFilename passed in trought the constructor to be functions instead of string only?

In our case it would make it easy to toggle the [hashcontent] for some bundles.
We would pass the option as followed:
filename: (chunk) => chunk.name === "NotHashedBundle" ? '[name].css' : '[name].[contenthash].css'

Might be worth noting that the latest version of webpack also supports something simular to this in their output.
eg: filename: (data) => data.chunk.name === "NotHashedBundle" ? '[name].js' : '[name].[chunkhash].js'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions