Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make module name relative #64

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -395,7 +396,7 @@ function buildPrecompileOptions<EnvSpecificOptions>(
// 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
Expand Down