Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
Fallback to empty object when plugin is undefined. Fixes #2.
Browse files Browse the repository at this point in the history
  • Loading branch information
robinvdvleuten committed May 16, 2018
1 parent a5a1503 commit 8f086b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 8f086b9

Please sign in to comment.