Skip to content

Commit

Permalink
Ensure the real plugin's static methods are invoked
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue committed Oct 15, 2021
1 parent 237a61f commit bb1e72c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cjs-wrapper.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
let RealPlugin;

module.exports = class FakeCJSWrapperPlugin {
static async isEnabled() {
static async isEnabled(...args) {
// we use the async of this method to enable us to absorb the dynamic
// import statement

Expand All @@ -14,6 +14,12 @@ module.exports = class FakeCJSWrapperPlugin {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
let RealPluginModule = await import('./index.js');
RealPlugin = RealPluginModule.default;

return RealPlugin.isEnabled(...args);
}

static disablePlugin(...args) {
return RealPlugin.disablePlugin(...args);
}

constructor(...args) {
Expand Down

0 comments on commit bb1e72c

Please sign in to comment.