From 4efe03f8ea34a55749e8369613313c54896ff18e Mon Sep 17 00:00:00 2001 From: Alec Jacob Deitloff Date: Thu, 4 Apr 2019 10:51:28 -0700 Subject: [PATCH] prevent setAssets from modifying original externals array --- lib/index.js | 2 +- src/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 432e68d1..21cb854f 100644 --- a/lib/index.js +++ b/lib/index.js @@ -327,7 +327,7 @@ var OfflinePlugin = (function () { var excludes = this.options.excludes; var assets = Object.keys(compilation.assets); - var externals = this.options.externals; + var externals = this.options.externals.slice(); if (Array.isArray(excludes) && excludes.length) { assets = assets.filter(function (asset) { diff --git a/src/index.js b/src/index.js index 903bada2..1eba3591 100644 --- a/src/index.js +++ b/src/index.js @@ -339,7 +339,7 @@ export default class OfflinePlugin { const excludes = this.options.excludes; let assets = Object.keys(compilation.assets); - let externals = this.options.externals; + let externals = this.options.externals.slice(); if (Array.isArray(excludes) && excludes.length) { assets = assets.filter((asset) => {