Skip to content

Commit 835624c

Browse files
committed
feat: fix test and names
1 parent a06f5df commit 835624c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,9 @@ class MiniCssExtractPlugin {
372372
}
373373

374374
getFilename(chunk, filename) {
375-
return this.isFunction(filename)
376-
? filename(chunk.chunk || chunk)
377-
: filename;
375+
console.log('--chunk--');
376+
console.log(chunk);
377+
return this.isFunction(filename) ? filename(chunk) : filename;
378378
}
379379

380380
isFunction(functionToCheck) {

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

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

0 commit comments

Comments
 (0)