From 3320cfe669ce1185581f71f7e400adff189bb051 Mon Sep 17 00:00:00 2001 From: Patrick Pircher Date: Tue, 24 Sep 2024 09:48:48 +0200 Subject: [PATCH] make module name relative --- src/plugin.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugin.ts b/src/plugin.ts index 50bd5a8..0849c35 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -8,6 +8,7 @@ import type { EmberTemplateCompiler, PreprocessOptions } from './ember-template- import { LegacyModuleName } from './public-types'; import { ScopeLocals } from './scope-locals'; import { ASTPluginBuilder, preprocess, print } from '@glimmer/syntax'; +import { relative } from 'path'; export * from './public-types'; @@ -395,7 +396,7 @@ function buildPrecompileOptions( // TODO: embroider's template-compiler allows this to be overriden to get // backward-compatible module names that don't match the real name of the // on-disk file. What's our plan for migrating people away from that? - moduleName: state.filename, + moduleName: relative(process.cwd(), state.filename), // This is here so it's *always* the real filename. Historically, there is // also `moduleName` but that did not match the real on-disk filename, it