Skip to content

Commit 52cf7f6

Browse files
committed
feat: update tests
1 parent 85f6eda commit 52cf7f6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,9 @@ class MiniCssExtractPlugin {
268268
if (Object.keys(chunkMap).length > 0) {
269269
const chunkMaps = chunk.getChunkMaps();
270270
const linkHrefPath = mainTemplate.getAssetPath(
271-
JSON.stringify(this.options.chunkFilename),
271+
JSON.stringify(
272+
this.getFilename(chunk, this.options.chunkFilename)
273+
),
272274
{
273275
hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`,
274276
hashWithLength: (length) =>

test/cases/filename-function/webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ module.exports = {
1818
},
1919
plugins: [
2020
new Self({
21-
filename: (chunk) => chunk == 'app' ? 'this.is.app.css' : '[name].css',
22-
chunkFilename: (chunk) => '[name].css',
21+
filename: (data) => data.chunk.name == 'app' ? 'this.is.app.css' : `[name].css`,
22+
chunkFilename: (data) => '[name].css',
2323
}),
2424
],
2525
};

0 commit comments

Comments
 (0)