Skip to content

Commit ed14165

Browse files
committed
Fixed issues with Object.assign
1 parent df8cda2 commit ed14165

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

lib/index.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,21 @@ class BundleTrackerPlugin {
6666
* @returns this
6767
*/
6868
_setParamsFromCompiler(compiler) {
69-
this.options = Object.assign({}, this.options, {
70-
path: compiler.options.output?.path ?? process.cwd(),
71-
publicPath: compiler.options.output?.publicPath ?? '',
72-
filename: 'webpack-stats.json',
73-
logTime: false,
74-
relativePath: false,
75-
integrity: false,
76-
indent: 2,
77-
// https://www.w3.org/TR/SRI/#cryptographic-hash-functions
78-
integrityHashes: ['sha256', 'sha384', 'sha512'],
79-
});
69+
this.options = Object.assign(
70+
{},
71+
{
72+
path: compiler.options.output?.path ?? process.cwd(),
73+
publicPath: compiler.options.output?.publicPath ?? '',
74+
filename: 'webpack-stats.json',
75+
logTime: false,
76+
relativePath: false,
77+
integrity: false,
78+
indent: 2,
79+
// https://www.w3.org/TR/SRI/#cryptographic-hash-functions
80+
integrityHashes: ['sha256', 'sha384', 'sha512'],
81+
},
82+
this.options,
83+
);
8084

8185
if (this.options.filename?.includes('/')) {
8286
throw Error(

tests/fixtures/commons.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
const output = { name: '' };
44

5-
Object.assign({}, output, { name: 'common' });
5+
Object.assign(output, { name: 'common' });
66

77
module.exports = output;

0 commit comments

Comments
 (0)