Skip to content

Commit 5bf6a1c

Browse files
committed
refactor: Remove unnecessary generates matcher
1 parent cd2a552 commit 5bf6a1c

4 files changed

Lines changed: 3 additions & 35 deletions

File tree

src/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Plugin, ResolvedConfig } from 'vite';
22
import { CodegenContext, generate, loadContext } from '@graphql-codegen/cli';
3-
import { createMatcher, isDocumentMatch, isGeneratedMatch } from './matchers';
3+
import { createMatcher, isDocumentMatch } from './matchers';
44

55
export default function VitePluginGraphQLCodegen(): Plugin {
66
let viteConfig: ResolvedConfig;
@@ -28,9 +28,6 @@ export default function VitePluginGraphQLCodegen(): Plugin {
2828
const listener = async (absolutePath = '') => {
2929
const matcher = createMatcher(absolutePath, viteConfig);
3030

31-
const isGenerated = await isGeneratedMatch(matcher, codegenContext);
32-
if (isGenerated) return;
33-
3431
const isDocument = await isDocumentMatch(matcher, codegenContext);
3532
if (!isDocument) return;
3633

src/matchers/createMatcher.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ import minimatch from 'minimatch';
33

44
export type Matcher = ReturnType<typeof createMatcher>;
55

6-
export default function createMatcher(
7-
absolutePath: string,
8-
config: ResolvedConfig
9-
) {
6+
export function createMatcher(absolutePath: string, config: ResolvedConfig) {
107
const getRelativePath = (path: string) => {
118
return path.split(`${config.root}/`).slice(-1)[0];
129
};

src/matchers/generated.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/matchers/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
export { default as createMatcher } from './createMatcher';
1+
export * from './createMatcher';
22
export * from './documents';
3-
export * from './generated';

0 commit comments

Comments
 (0)