diff --git a/packages/compiler-core/__tests__/transform.spec.ts b/packages/compiler-core/__tests__/transform.spec.ts index 915ae7a60cd..3e638ccd970 100644 --- a/packages/compiler-core/__tests__/transform.spec.ts +++ b/packages/compiler-core/__tests__/transform.spec.ts @@ -35,7 +35,8 @@ describe('compiler: transform', () => { } transform(ast, { - nodeTransforms: [plugin] + nodeTransforms: [plugin], + filename: 'example.vue' }) const div = ast.children[0] as ElementNode @@ -43,6 +44,7 @@ describe('compiler: transform', () => { expect(calls[0]).toMatchObject([ ast, { + filename: 'example.vue', parent: null, currentNode: ast } diff --git a/packages/compiler-core/src/transform.ts b/packages/compiler-core/src/transform.ts index 3cb3e6bf01f..f5549e3b39c 100644 --- a/packages/compiler-core/src/transform.ts +++ b/packages/compiler-core/src/transform.ts @@ -82,9 +82,7 @@ export interface ImportItem { } export interface TransformContext - extends Required< - Omit - >, + extends Required>, CompilerCompatOptions { selfName: string | null root: RootNode @@ -152,6 +150,7 @@ export function createTransformContext( const context: TransformContext = { // options selfName: nameMatch && capitalize(camelize(nameMatch[1])), + filename, prefixIdentifiers, hoistStatic, cacheHandlers,