From b4627f29b2de58486bff05f5e178215075f29425 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 22 Oct 2024 11:05:48 +0200 Subject: [PATCH] cli: raw-loader fix Signed-off-by: Patrik Oldsberg --- .changeset/pretty-zebras-listen.md | 5 +++++ packages/cli/src/lib/bundler/config.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/pretty-zebras-listen.md diff --git a/.changeset/pretty-zebras-listen.md b/.changeset/pretty-zebras-listen.md new file mode 100644 index 0000000000..d7ee0faef4 --- /dev/null +++ b/.changeset/pretty-zebras-listen.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Fixed an issue where the `raw-loader` for loading HTML templates was not resolved from the context of the CLI package. diff --git a/packages/cli/src/lib/bundler/config.ts b/packages/cli/src/lib/bundler/config.ts index c61c117452..bd07c92f6f 100644 --- a/packages/cli/src/lib/bundler/config.ts +++ b/packages/cli/src/lib/bundler/config.ts @@ -209,7 +209,7 @@ export async function createConfig( minify: false, publicPath: '<%= publicPath %>', filename: 'index.html.tmpl', - template: `raw-loader!${paths.targetHtml}`, + template: `${require.resolve('raw-loader')}!${paths.targetHtml}`, }), ); }