|
@@ -8,7 +8,7 @@ export function viteConfigPlugin({ packageRoot }: { packageRoot: string }): Plug
|
|
|
// Only set the vite `root` to the dashboard package when running the dev server.
|
|
// Only set the vite `root` to the dashboard package when running the dev server.
|
|
|
// During a production build we still need to reference the dashboard source which
|
|
// During a production build we still need to reference the dashboard source which
|
|
|
// lives in `node_modules`, but we don't want the build output to be emitted in there.
|
|
// lives in `node_modules`, but we don't want the build output to be emitted in there.
|
|
|
- // Therefore we set `root` only for `serve` and, for `build`, we instead make sure that
|
|
|
|
|
|
|
+ // Therefore, we set `root` only for `serve` and, for `build`, we instead make sure that
|
|
|
// an `outDir` **outside** of `node_modules` is used (defaulting to the current working
|
|
// an `outDir` **outside** of `node_modules` is used (defaulting to the current working
|
|
|
// directory if the user did not provide one already).
|
|
// directory if the user did not provide one already).
|
|
|
config.root = packageRoot;
|
|
config.root = packageRoot;
|
|
@@ -37,6 +37,7 @@ export function viteConfigPlugin({ packageRoot }: { packageRoot: string }): Plug
|
|
|
config.resolve = {
|
|
config.resolve = {
|
|
|
alias: {
|
|
alias: {
|
|
|
...(config.resolve?.alias ?? {}),
|
|
...(config.resolve?.alias ?? {}),
|
|
|
|
|
+ // See the readme for an explanation of this alias.
|
|
|
'@/vdb': path.resolve(packageRoot, './src/lib'),
|
|
'@/vdb': path.resolve(packageRoot, './src/lib'),
|
|
|
'@/graphql': path.resolve(packageRoot, './src/lib/graphql'),
|
|
'@/graphql': path.resolve(packageRoot, './src/lib/graphql'),
|
|
|
},
|
|
},
|