Skip to content

Commit

Permalink
fix: memory leak (#426)
Browse files Browse the repository at this point in the history
  • Loading branch information
cap-Bernardito authored Jul 2, 2021
1 parent 3332a1d commit d74f740
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ async function lessLoader(source) {
return;
}

delete lessOptions.pluginManager.webpackLoaderContext;
delete lessOptions.pluginManager;

const { css, imports } = result;

imports.forEach((item) => {
Expand Down
2 changes: 2 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ function getLessOptions(loaderContext, loaderOptions, implementation) {
install(lessProcessor, pluginManager) {
// eslint-disable-next-line no-param-reassign
pluginManager.webpackLoaderContext = loaderContext;

lessOptions.pluginManager = pluginManager;
},
});

Expand Down

0 comments on commit d74f740

Please sign in to comment.