Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: fix test and names
  • Loading branch information
berthertogen committed May 14, 2018
commit 835624c0e91d0362778a2d897f3cac64ab57dbc2
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,9 @@ class MiniCssExtractPlugin {
}

getFilename(chunk, filename) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed

return this.isFunction(filename)
? filename(chunk.chunk || chunk)
: filename;
console.log('--chunk--');
console.log(chunk);
return this.isFunction(filename) ? filename(chunk) : filename;
}

isFunction(functionToCheck) {
Expand Down
4 changes: 2 additions & 2 deletions test/cases/filename-function/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ module.exports = {
},
plugins: [
new Self({
filename: (data) => data.chunk.name == 'app' ? 'this.is.app.css' : `[name].css`,
chunkFilename: (data) => '[name].css',
filename: (chunk) => chunk.name == 'app' ? 'this.is.app.css' : `[name].css`,
chunkFilename: (chunk) => '[name].css',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chunkFilename can't be a function

}),
],
};