Skip to content

Commit d74f740

Browse files
fix: memory leak (#426)
1 parent 3332a1d commit d74f740

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ async function lessLoader(source) {
5757
return;
5858
}
5959

60+
delete lessOptions.pluginManager.webpackLoaderContext;
61+
delete lessOptions.pluginManager;
62+
6063
const { css, imports } = result;
6164

6265
imports.forEach((item) => {

src/utils.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ function getLessOptions(loaderContext, loaderOptions, implementation) {
189189
install(lessProcessor, pluginManager) {
190190
// eslint-disable-next-line no-param-reassign
191191
pluginManager.webpackLoaderContext = loaderContext;
192+
193+
lessOptions.pluginManager = pluginManager;
192194
},
193195
});
194196

0 commit comments

Comments
 (0)