Skip to content

Commit 60eaf9c

Browse files
authored
refactor: allow CommonJS require() without .default (#150)
1 parent 8a848f5 commit 60eaf9c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,6 @@ const PostGraphileConnectionFilterPlugin: Plugin = (builder, configOptions) => {
7979
PgConnectionArgFilterOperatorsPlugin(builder, options);
8080
};
8181

82-
export default PostGraphileConnectionFilterPlugin;
82+
// TODO: In the next major version, change `export =` to `export default`.
83+
// This will be a breaking change for CommonJS users.
84+
export = PostGraphileConnectionFilterPlugin;

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"noUnusedParameters": true,
2020
"noUnusedLocals": true,
2121
"preserveWatchOutput": true,
22+
"esModuleInterop": true,
2223
"lib": ["es2018", "esnext.asynciterable"]
2324
},
2425
"include": ["src/**/*"]

0 commit comments

Comments
 (0)