Skip to content

Commit cf7b731

Browse files
committed
feat: remove throw and change isFunction
1 parent 52cf7f6 commit cf7b731

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/index.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,6 @@ class MiniCssExtractPlugin {
111111
options
112112
);
113113
if (!this.options.chunkFilename) {
114-
if (this.isFunction(this.options.filename)) {
115-
throw new Error(
116-
`You are required to provide a value for chunkFilename when using a Function for this.options.filename, please specify the [name], [id] or [chunkhash] in this function`
117-
);
118-
}
119114
const { filename } = this.options;
120115
const hasName = filename.includes('[name]');
121116
const hasId = filename.includes('[id]');
@@ -381,10 +376,7 @@ class MiniCssExtractPlugin {
381376
}
382377

383378
isFunction(functionToCheck) {
384-
return (
385-
functionToCheck &&
386-
{}.toString.call(functionToCheck) === '[object Function]'
387-
);
379+
return typeof functionToCheck === 'function';
388380
}
389381

390382
getCssChunkObject(mainChunk) {

0 commit comments

Comments
 (0)