From df9444cfc43b3a96886f4aea368cf2eae1d3c24b Mon Sep 17 00:00:00 2001 From: guybedford Date: Wed, 5 Dec 2018 18:52:04 +0200 Subject: [PATCH] fixup loader order --- src/index.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/index.js b/src/index.js index 97c20efa..afceae25 100644 --- a/src/index.js +++ b/src/index.js @@ -121,7 +121,10 @@ module.exports = async ( }, { test: /\.(js|mjs|tsx?)$/, - use: [{ + use: [...minify ? [{ + loader: __dirname + "/loaders/terser-loader.js", + options: { sourceMap } + }] : [], { loader: __dirname + "/loaders/relocate-loader.js", options: { assetNames, assets } }] @@ -135,15 +138,8 @@ module.exports = async ( outDir: '//' } } - }, - { - ...minify ? [{ - test: /\.(js|mjs)$/, - use: [{ - loader: __dirname + "/loaders/terser-loader.js", - options: { sourceMap } }] - }] : [] + } ] }, plugins: [