From 60eaf9caa3a5ee6c451011626c977bdd92eb333e Mon Sep 17 00:00:00 2001 From: Matt Bretl Date: Sat, 10 Apr 2021 10:27:23 -0700 Subject: [PATCH] refactor: allow CommonJS require() without .default (#150) --- src/index.ts | 4 +++- tsconfig.json | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 6daf253..cad927c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -79,4 +79,6 @@ const PostGraphileConnectionFilterPlugin: Plugin = (builder, configOptions) => { PgConnectionArgFilterOperatorsPlugin(builder, options); }; -export default PostGraphileConnectionFilterPlugin; +// TODO: In the next major version, change `export =` to `export default`. +// This will be a breaking change for CommonJS users. +export = PostGraphileConnectionFilterPlugin; diff --git a/tsconfig.json b/tsconfig.json index 2023aee..11c5b7f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,6 +19,7 @@ "noUnusedParameters": true, "noUnusedLocals": true, "preserveWatchOutput": true, + "esModuleInterop": true, "lib": ["es2018", "esnext.asynciterable"] }, "include": ["src/**/*"]