From 5307ca7df4dce4bc3e4323e9a177fcf784944bfa Mon Sep 17 00:00:00 2001 From: Jan Lentmaier Date: Wed, 19 Apr 2023 09:48:03 +0000 Subject: [PATCH 1/3] fix: parsing circular json When reading outputoptions, they can become circular. This fixes that and only requires necessary infos. --- src/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 4f16cef..cb3c634 100644 --- a/src/index.js +++ b/src/index.js @@ -21,7 +21,12 @@ function pitch() { }), _compiler: { fsStartTime: this._compiler.fsStartTime }, _compilation: { - outputOptions: this._compilation.outputOptions, + outputOptions: { + hashSalt: this._compilation.outputOptions.hashSalt, + hashFunction: this._compilation.outputOptions.hashFunction, + hashDigest: this._compilation.outputOptions.hashDigest, + hashDigestLength: this._compilation.outputOptions.hashDigestLength, + }, options: this._compilation.options, }, resourcePath: this.resourcePath, From bb77c29642cedebfcd5f11f1823e21e2fca948cb Mon Sep 17 00:00:00 2001 From: Jan Lentmaier Date: Wed, 19 Apr 2023 13:17:29 +0000 Subject: [PATCH 2/3] fix: add devtool to options --- src/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index cb3c634..1396407 100644 --- a/src/index.js +++ b/src/index.js @@ -27,7 +27,12 @@ function pitch() { hashDigest: this._compilation.outputOptions.hashDigest, hashDigestLength: this._compilation.outputOptions.hashDigestLength, }, - options: this._compilation.options, + options: { + devtool: + this._compilation && + this._compilation.options && + this._compilation.options.devtool, + }, }, resourcePath: this.resourcePath, resource: this.resourcePath + (this.resourceQuery || ''), From 88060226e15da5b41120ff89cd67c61c9e58a0fe Mon Sep 17 00:00:00 2001 From: Jan Lentmaier Date: Wed, 19 Apr 2023 13:32:27 +0000 Subject: [PATCH 3/3] fix: add devtool for test config --- test/sass-loader-example/webpack.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/sass-loader-example/webpack.config.js b/test/sass-loader-example/webpack.config.js index 3d5a4dc..0346dc6 100644 --- a/test/sass-loader-example/webpack.config.js +++ b/test/sass-loader-example/webpack.config.js @@ -31,6 +31,7 @@ module.exports = (env) => { return { mode: 'none', context: __dirname, + devtool: false, entry: ['./index.js'], output: { path: path.resolve('dist'),