From 4fc70396c797134e9652450ea0e30452c44d40a2 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Sat, 29 Sep 2018 14:29:49 -0400 Subject: [PATCH] Adds image optimization if folder is missing --- webpack.config.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webpack.config.js b/webpack.config.js index b45eda2..59f6aca 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -18,6 +18,10 @@ module.exports = function(env, argv) { env.optimizeImages = env.production || Boolean(env.optimizeImages); env.copyClipboardyFallbacks = env.production || Boolean(env.copyClipboardyFallbacks); + if (!env.optimizeImages && !fs.existsSync(path.resolve(__dirname, 'images/settings'))) { + env.optimizeImages = true; + } + if (!env.copyClipboardyFallbacks && !fs.existsSync(path.resolve(__dirname, 'fallbacks'))) { env.copyClipboardyFallbacks = true; }