diff --git a/src/index.js b/src/index.js index 02c3ec176..2bf129152 100644 --- a/src/index.js +++ b/src/index.js @@ -96,6 +96,15 @@ module.exports = async ( test: /\.node$/, use: [{ loader: __dirname + "/loaders/node-loader.js", + }] + }, + { + test: /\.(js|mjs)$/, + use: [...minify ? [{ + loader: __dirname + "/loaders/terser-loader.js", + options: { sourceMap } + }] : [], { + loader: __dirname + "/loaders/relocate-loader.js", options: { assetNames, assets } }] }, @@ -109,15 +118,7 @@ module.exports = async ( { test: /\.tsx?$/, use: [{ loader: __dirname + "/loaders/ts-loader.js" }] - }, - { - ...minify ? [{ - test: /\.(js|mjs)$/, - use: [{ - loader: __dirname + "/loaders/terser-loader.js", - options: { sourceMap } - }] - }] : [] + } ] }, plugins: [