match prod css bundle (#102)

This commit is contained in:
Danny Skubak 2019-12-05 20:01:47 -05:00 committed by Daniel Ternyak
parent 3311be8e98
commit 64d832d585
1 changed files with 6 additions and 1 deletions

View File

@ -26,7 +26,12 @@ const HTML: React.SFC<Props> = ({
// Move `bundle.css` to beginning of array so custom styles don't get overwritten
const bundleIndex = extractedStyleElements.findIndex(element => {
return typeof element.key === 'string' && /^.*\/bundle\.css$/.test(element.key);
const devBundle = /^.*\/bundle\.css$/;
const prodBundle = /^.*\/bundle\..*\.css$/;
return (
typeof element.key === 'string' &&
(devBundle.test(element.key) || prodBundle.test(element.key))
);
});
if (bundleIndex !== -1) {
const [bundle] = extractedStyleElements.splice(bundleIndex, 1);