Skip to content

Commit

Permalink
incl preset paths
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Dec 12, 2024
1 parent 73d8ee7 commit 63e4fe5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export function defineEnv(opts: CreateEnvOptions = {}): {
url: [
...(opts.resolve === true ? [] : opts.resolve.paths || []),
__dirname, // unenv
...(presets
.map((preset) => preset.meta?.url)
.filter(Boolean) as string[]),
],
};
const _resolve = (id: string) => resolvePathSync(id, resolveOpts);
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ export interface Preset {
readonly version?: string;

/**
* Path to preset directory usable for absolute path imports
* Path or URL to preset entry (used for resolving absolute paths).
*/
readonly path?: string;
readonly url?: string | URL;
};

alias?: Environment["alias"];
Expand Down

0 comments on commit 63e4fe5

Please sign in to comment.