Skip to content

Commit

Permalink
Switch to regex in case the casing was wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
developit authored Dec 3, 2018
1 parent 81ab6c8 commit 5d827f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ async function prerender (parentCompilation, request, options, inject, loader) {
};

// Only copy over allowed plugins (excluding them breaks extraction entirely).
const allowedPlugins = ['MiniCssExtractPlugin', 'ExtractTextPlugin'];
const plugins = (parentCompiler.options.plugins || []).filter(c => allowedPlugins.includes(c.constructor.name));
const allowedPlugins = /(MiniCssExtractPlugin|ExtractTextPlugin)/i;
const plugins = (parentCompiler.options.plugins || []).filter(c => allowedPlugins.test(c.constructor.name));

// Compile to an in-memory filesystem since we just want the resulting bundled code as a string
const compiler = parentCompilation.createChildCompiler('prerender', outputOptions, plugins);
Expand Down

0 comments on commit 5d827f8

Please sign in to comment.