Skip to content

Commit 3ffb2d2

Browse files
jalexy12Copilot
andauthored
Dynamic alias (#47)
We need a dynamic alias for tests to be able to build for tests etc. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent adaafe6 commit 3ffb2d2

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

vite.config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ import { runtimeTelemetryPlugin } from "@github/spark/telemetryPlugin";
1111
import sparkAgent from "@github/spark/agent-plugin";
1212
import { tagSourcePlugin, designerHost } from "@github/spark/designerPlugin";
1313
import createIconImportProxy from "@github/spark/vitePhosphorIconProxyPlugin";
14+
import { resolve } from 'path'
1415

1516
const extraPlugins: PluginOption[] = [];
1617

1718
const GITHUB_RUNTIME_PERMANENT_NAME = process.env.GITHUB_RUNTIME_PERMANENT_NAME || process.env.CODESPACE_NAME?.substring(0, 20);
19+
const projectRoot = process.env.PROJECT_ROOT || "/workspaces/spark-template"
1820

1921
// https://vite.dev/config/
2022
export default defineConfig({
@@ -82,8 +84,8 @@ export default defineConfig({
8284
},
8385
resolve: {
8486
alias: {
85-
"@": "/workspaces/spark-template/src"
87+
'@': resolve(projectRoot, 'src')
8688
}
8789
},
8890
customLogger: createLogToFileLogger(),
89-
});
91+
});

0 commit comments

Comments
 (0)