We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f14df8 commit ad341bfCopy full SHA for ad341bf
lib/index.js
@@ -4,10 +4,11 @@ function CssChunkHashPlugin(options) {
4
}, options);
5
}
6
7
+const REGX_CSS = /\S*\.css\??[^.]\S*/;
8
CssChunkHashPlugin.prototype.createCssHash = function ({ assetsByChunkName, publicPath }) {
9
return Object.keys(assetsByChunkName).reduce((hash, name) => {
10
if (!assetsByChunkName[name] || !assetsByChunkName[name].find) return hash;
- const file = assetsByChunkName[name].find(file => file.endsWith('.css'));
11
+ const file = assetsByChunkName[name].find(file => REGX_CSS.test(file));
12
if (file) hash[name] = `${publicPath}${file}`;
13
return hash;
14
}, {});
0 commit comments