From 497c1370e5735eaaa5b5b9162e37834b575609ea Mon Sep 17 00:00:00 2001 From: ahabhgk Date: Fri, 15 Sep 2023 12:38:57 +0800 Subject: [PATCH 1/3] feat: compatible with rspack --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index fb7c93b..5334ff7 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ 'use strict'; -const {ProvidePlugin} = require('webpack'); + const filterObject = require('filter-obj'); function createAliasFilter({includeAliases, excludeAliases}) { @@ -24,6 +24,7 @@ module.exports = class NodePolyfillPlugin { } apply(compiler) { + const {ProvidePlugin} = compiler.webpack; const filter = createAliasFilter(this.options); compiler.options.plugins.push(new ProvidePlugin(filter({ From c2f3ed0ab208fa2ee6f17d7faaf9e9094ab9ff09 Mon Sep 17 00:00:00 2001 From: Richie Bendall Date: Mon, 9 Oct 2023 21:32:09 +1300 Subject: [PATCH 2/3] Update index.js --- index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/index.js b/index.js index 5334ff7..5434668 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,4 @@ 'use strict'; - const filterObject = require('filter-obj'); function createAliasFilter({includeAliases, excludeAliases}) { From 0f6c7f8e114a5c2d46489be2213613e0bab9ffe9 Mon Sep 17 00:00:00 2001 From: Richie Bendall Date: Mon, 9 Oct 2023 21:36:02 +1300 Subject: [PATCH 3/3] Update index.js --- index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.js b/index.js index 5434668..a5faf72 100644 --- a/index.js +++ b/index.js @@ -23,10 +23,9 @@ module.exports = class NodePolyfillPlugin { } apply(compiler) { - const {ProvidePlugin} = compiler.webpack; const filter = createAliasFilter(this.options); - compiler.options.plugins.push(new ProvidePlugin(filter({ + compiler.options.plugins.push(new compiler.webpack.ProvidePlugin(filter({ Buffer: [require.resolve('buffer/'), 'Buffer'], console: require.resolve('console-browserify'), process: require.resolve('process/browser')