diff --git a/index.js b/index.js index fb07ba5..eb51719 100644 --- a/index.js +++ b/index.js @@ -7,7 +7,7 @@ module.exports = (config, env, helpers) => { const { stringified, raw } = resolveEnvVars('PREACT_APP_'); config.plugins.push(new DefinePlugin(stringified)); - const { plugin: htmlPlugin } = helpers.getPluginsByName(config, 'HtmlWebpackPlugin')[0]; + const { plugin: htmlPlugin } = helpers.getPluginsByName(config, 'HtmlWebpackPlugin')[0] || {}; if (htmlPlugin) { // Pass all prefixed env vars to the HTML template.