Skip to content

Commit

Permalink
prevent setAssets from modifying original externals array
Browse files Browse the repository at this point in the history
  • Loading branch information
ahlec committed Apr 4, 2019
1 parent cbc9e1b commit 4efe03f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 4efe03f

Please sign in to comment.