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: allow the option filename to be a function #143

Closed
berthertogen opened this Issue May 14, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@berthertogen

berthertogen commented May 14, 2018

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'

@evilebottnawi

This comment has been minimized.

Member

evilebottnawi commented May 14, 2018

PR welcome 👍

@berthertogen

This comment has been minimized.

berthertogen commented May 14, 2018

Ok, I'm on it.

Quick question, at the moment I can't get the tests passing, I'm getting Error: expect(received).toEqual(expected) but the expected and received printed out after this message seem to be the same.
My encoding is the same (utf-8), from what I can see its failing on carriage return. Any hint on how to get this fixed?

@berthertogen berthertogen changed the title from Feature: allow the option filename to be a function. to feat: allow the option filename to be a function May 14, 2018

@berthertogen berthertogen referenced this issue May 14, 2018

Closed

feat: allow filename to be a `{Function}` #145

2 of 6 tasks complete
@glen-84

This comment has been minimized.

glen-84 commented Jun 16, 2018

Duplicate of #67?

@evilebottnawi

This comment has been minimized.

Member

evilebottnawi commented Aug 21, 2018

@glen-84 yep, duplicate.

Close in favor #67

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment