virtuals/utils
Esta página aún no está disponible en tu idioma.
Functions
Section titled “Functions”buildDefaultOnlyVirtual()
Section titled “buildDefaultOnlyVirtual()”function buildDefaultOnlyVirtual(mod: any): string
Defined in: studiocms/packages/studiocms/src/virtuals/utils.ts:14^
Builds a string representing a default export of the provided module object.
Parameters
Section titled “Parameters”any
The module object to be stringified and exported as default.
Returns
Section titled “Returns”string
A string containing a TypeScript/JavaScript default export statement with the serialized module.
buildLoggerVirtual()
Section titled “buildLoggerVirtual()”function buildLoggerVirtual(verbose: boolean): string
Defined in: studiocms/packages/studiocms/src/virtuals/utils.ts:127^
Builds the content for a logger virtual file by reading a logger stub file and replacing
the $$verbose$$
placeholder with the provided verbosity flag.
Parameters
Section titled “Parameters”verbose
Section titled “verbose”boolean
Determines whether verbose logging should be enabled.
Returns
Section titled “Returns”string
The logger file content with the verbosity setting applied.
buildNamedMultiExportVirtual()
Section titled “buildNamedMultiExportVirtual()”function buildNamedMultiExportVirtual(items: Record<string, string>): string
Defined in: studiocms/packages/studiocms/src/virtuals/utils.ts:34^
Builds a string containing multiple named ES module exports from a record of key-value pairs.
Each key in the input object becomes the exported constant’s name, and each value is stringified and assigned to the corresponding export.
Parameters
Section titled “Parameters”Record
<string
, string
>
An object where each key-value pair represents the name and value of an export.
Returns
Section titled “Returns”string
A string containing multiple export statements, one for each entry in the input object.
Example
Section titled “Example”const exports = buildNamedMultiExportVirtual({ foo: "bar", baz: "qux" });// exports:// export const foo = "bar";// export const baz = "qux";
buildVirtualConfig()
Section titled “buildVirtualConfig()”function buildVirtualConfig(options: { componentRegistry: Record<string, string>; dbStartPage: boolean; features: { authConfig: { enabled: boolean; providers: { usernameAndPassword: boolean; usernameAndPasswordConfig: { allowUserRegistration: boolean; }; }; }; dashboardConfig: { dashboardEnabled: boolean; dashboardRouteOverride: string; faviconURL: string; inject404Route: boolean; versionCheck: boolean; }; developerConfig: { demoMode: | false | { password: string; username: string; }; }; injectQuickActionsMenu: boolean; preferredImageService: string; robotsTXT: | boolean | { host: string | boolean; policy: { allow: string | string[]; cleanParam: string | string[]; crawlDelay: number; disallow: string | string[]; userAgent: | "*" | "360Spider" | "360Spider-Image" | "360Spider-Video" | "HaoSouSpider" | "AdsBot-Google" | "AdsBot-Google-Mobile" | "AdsBot-Google-Mobile-Apps" | "Googlebot" | "Googlebot-Image" | "Googlebot-Mobile" | "Googlebot-News" | "Googlebot-Video" | "Mediapartners-Google" | "adidxbot" | "bingbot" | "BingPreview" | "MicrosoftPreview" | "msnbot" | "msnbot-media" | "Applebot" | "AppleNewsBot" | "Baiduspider" | "Baiduspider-image" | "Baiduspider-mobile" | "Baiduspider-news" | "Baiduspider-video" | "coccoc" | "coccocbot-image" | "coccocbot-web" | "DuckDuckBot" | "DuckDuckGo-Favicons-Bot" | "facebookcatalog" | "facebookexternalhit" | "Facebot" | "gooblog" | "ichiro" | "Sogou blog" | "Sogou inst spider" | "Sogou News Spider" | "Sogou Orion spider" | "Sogou spider2" | "Sogou web spider" | "Yandex" | "YandexMobileBot" | "Algolia Crawler" | "BublupBot" | "CCBot" | "Cliqzbot" | "Daumoa" | "DeuSu" | "EuripBot" | "Exploratodo" | "Feedly" | "Findxbot" | "istellabot" | "JikeSpider" | "Lycos" | "Mail.Ru" | "MojeekBot" | "OrangeBot" | "Pinterest" | "Plukkie" | "Qwantify" | "Rambler" | "SemanticScholarBot" | "SeznamBot" | "Sosospider" | "Slurp" | "Twitterbot" | "WhatsApp" | "yacybot" | "YepBot" | "Yeti" | "YioopBot" | "yoozBot" | "YoudaoBot" | ( | "*" | "360Spider" | "360Spider-Image" | "360Spider-Video" | "HaoSouSpider" | "AdsBot-Google" | "AdsBot-Google-Mobile" | "AdsBot-Google-Mobile-Apps" | "Googlebot" | "Googlebot-Image" | "Googlebot-Mobile" | "Googlebot-News" | "Googlebot-Video" | "Mediapartners-Google" | "adidxbot" | "bingbot" | "BingPreview" | "MicrosoftPreview" | "msnbot" | "msnbot-media" | "Applebot" | "AppleNewsBot" | "Baiduspider" | "Baiduspider-image" | "Baiduspider-mobile" | "Baiduspider-news" | "Baiduspider-video" | "coccoc" | "coccocbot-image" | "coccocbot-web" | "DuckDuckBot" | "DuckDuckGo-Favicons-Bot" | "facebookcatalog" | "facebookexternalhit" | "Facebot" | "gooblog" | "ichiro" | "Sogou blog" | "Sogou inst spider" | "Sogou News Spider" | "Sogou Orion spider" | "Sogou spider2" | "Sogou web spider" | "Yandex" | "YandexMobileBot" | "Algolia Crawler" | "BublupBot" | "CCBot" | "Cliqzbot" | "Daumoa" | "DeuSu" | "EuripBot" | "Exploratodo" | "Feedly" | "Findxbot" | "istellabot" | "JikeSpider" | "Lycos" | "Mail.Ru" | "MojeekBot" | "OrangeBot" | "Pinterest" | "Plukkie" | "Qwantify" | "Rambler" | "SemanticScholarBot" | "SeznamBot" | "Sosospider" | "Slurp" | "Twitterbot" | "WhatsApp" | "yacybot" | "YepBot" | "Yeti" | "YioopBot" | "yoozBot" | "YoudaoBot")[]; }[]; sitemap: string | boolean | string[]; }; sdk: { cacheConfig: { enabled: boolean; lifetime: number; }; }; }; locale: { dateLocale: string; dateTimeFormat: DateTimeFormatOptions; }; logLevel: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None"; plugins: StudioCMSPlugin[]; verbose: boolean; }): string
Defined in: studiocms/packages/studiocms/src/virtuals/utils.ts:115^
Builds the virtual configuration file content by injecting the provided StudioCMS options into a configuration stub template.
Parameters
Section titled “Parameters”options
Section titled “options”The configuration options to be injected into the stub template.
componentRegistry?
Section titled “componentRegistry?”Record
<string
, string
> = ...
Component Registry
dbStartPage
Section titled “dbStartPage”boolean
= ...
Project Initialization Page - Used during First Time Setup to initialize the database
Default
true
features
Section titled “features”{
authConfig
: {
enabled
: boolean
;
providers
: {
usernameAndPassword
: boolean
;
usernameAndPasswordConfig
: {
allowUserRegistration
: boolean
;
};
};
};
dashboardConfig
: {
dashboardEnabled
: boolean
;
dashboardRouteOverride
: string
;
faviconURL
: string
;
inject404Route
: boolean
;
versionCheck
: boolean
;
};
developerConfig
: {
demoMode
: | false
| {
password
: string
;
username
: string
;
};
};
injectQuickActionsMenu
: boolean
;
preferredImageService
: string
;
robotsTXT
: | boolean
| {
host
: string
| boolean
;
policy
: {
allow
: string
| string
[];
cleanParam
: string
| string
[];
crawlDelay
: number
;
disallow
: string
| string
[];
userAgent
: | "*"
| "360Spider"
| "360Spider-Image"
| "360Spider-Video"
| "HaoSouSpider"
| "AdsBot-Google"
| "AdsBot-Google-Mobile"
| "AdsBot-Google-Mobile-Apps"
| "Googlebot"
| "Googlebot-Image"
| "Googlebot-Mobile"
| "Googlebot-News"
| "Googlebot-Video"
| "Mediapartners-Google"
| "adidxbot"
| "bingbot"
| "BingPreview"
| "MicrosoftPreview"
| "msnbot"
| "msnbot-media"
| "Applebot"
| "AppleNewsBot"
| "Baiduspider"
| "Baiduspider-image"
| "Baiduspider-mobile"
| "Baiduspider-news"
| "Baiduspider-video"
| "coccoc"
| "coccocbot-image"
| "coccocbot-web"
| "DuckDuckBot"
| "DuckDuckGo-Favicons-Bot"
| "facebookcatalog"
| "facebookexternalhit"
| "Facebot"
| "gooblog"
| "ichiro"
| "Sogou blog"
| "Sogou inst spider"
| "Sogou News Spider"
| "Sogou Orion spider"
| "Sogou spider2"
| "Sogou web spider"
| "Yandex"
| "YandexMobileBot"
| "Algolia Crawler"
| "BublupBot"
| "CCBot"
| "Cliqzbot"
| "Daumoa"
| "DeuSu"
| "EuripBot"
| "Exploratodo"
| "Feedly"
| "Findxbot"
| "istellabot"
| "JikeSpider"
| "Lycos"
| "Mail.Ru"
| "MojeekBot"
| "OrangeBot"
| "Pinterest"
| "Plukkie"
| "Qwantify"
| "Rambler"
| "SemanticScholarBot"
| "SeznamBot"
| "Sosospider"
| "Slurp"
| "Twitterbot"
| "WhatsApp"
| "yacybot"
| "YepBot"
| "Yeti"
| "YioopBot"
| "yoozBot"
| "YoudaoBot"
| (
| "*"
| "360Spider"
| "360Spider-Image"
| "360Spider-Video"
| "HaoSouSpider"
| "AdsBot-Google"
| "AdsBot-Google-Mobile"
| "AdsBot-Google-Mobile-Apps"
| "Googlebot"
| "Googlebot-Image"
| "Googlebot-Mobile"
| "Googlebot-News"
| "Googlebot-Video"
| "Mediapartners-Google"
| "adidxbot"
| "bingbot"
| "BingPreview"
| "MicrosoftPreview"
| "msnbot"
| "msnbot-media"
| "Applebot"
| "AppleNewsBot"
| "Baiduspider"
| "Baiduspider-image"
| "Baiduspider-mobile"
| "Baiduspider-news"
| "Baiduspider-video"
| "coccoc"
| "coccocbot-image"
| "coccocbot-web"
| "DuckDuckBot"
| "DuckDuckGo-Favicons-Bot"
| "facebookcatalog"
| "facebookexternalhit"
| "Facebot"
| "gooblog"
| "ichiro"
| "Sogou blog"
| "Sogou inst spider"
| "Sogou News Spider"
| "Sogou Orion spider"
| "Sogou spider2"
| "Sogou web spider"
| "Yandex"
| "YandexMobileBot"
| "Algolia Crawler"
| "BublupBot"
| "CCBot"
| "Cliqzbot"
| "Daumoa"
| "DeuSu"
| "EuripBot"
| "Exploratodo"
| "Feedly"
| "Findxbot"
| "istellabot"
| "JikeSpider"
| "Lycos"
| "Mail.Ru"
| "MojeekBot"
| "OrangeBot"
| "Pinterest"
| "Plukkie"
| "Qwantify"
| "Rambler"
| "SemanticScholarBot"
| "SeznamBot"
| "Sosospider"
| "Slurp"
| "Twitterbot"
| "WhatsApp"
| "yacybot"
| "YepBot"
| "Yeti"
| "YioopBot"
| "yoozBot"
| "YoudaoBot"
)[];
}[];
sitemap
: string
| boolean
| string
[];
};
sdk
: {
cacheConfig
: {
enabled
: boolean
;
lifetime
: number
;
};
};
} = ...
Allows adjusting the StudioCMS Dashboard features
features.authConfig
Section titled “features.authConfig”{
enabled
: boolean
;
providers
: {
usernameAndPassword
: boolean
;
usernameAndPasswordConfig
: {
allowUserRegistration
: boolean
;
};
};
} = authConfigSchema
Auth Configuration - Allows customization of the Authentication Configuration
features.authConfig.enabled
Section titled “features.authConfig.enabled”boolean
= ...
Auth Enabled - Allows enabling or disabling of the Authentication Configuration
Default
true
features.authConfig.providers
Section titled “features.authConfig.providers”{
usernameAndPassword
: boolean
;
usernameAndPasswordConfig
: {
allowUserRegistration
: boolean
;
};
} = authProviderSchema
Auth Providers - Allows enabling or disabling of the Authentication Providers
features.authConfig.providers.usernameAndPassword
Section titled “features.authConfig.providers.usernameAndPassword”boolean
= ...
Username and Password Auth Provider
features.authConfig.providers.usernameAndPasswordConfig
Section titled “features.authConfig.providers.usernameAndPasswordConfig”{
allowUserRegistration
: boolean
;
} = localUsernameAndPasswordConfig
features.authConfig.providers.usernameAndPasswordConfig.allowUserRegistration
Section titled “features.authConfig.providers.usernameAndPasswordConfig.allowUserRegistration”boolean
= ...
Allow User Registration - Allows users to register an account
Default
false
features.dashboardConfig
Section titled “features.dashboardConfig”{
dashboardEnabled
: boolean
;
dashboardRouteOverride
: string
;
faviconURL
: string
;
inject404Route
: boolean
;
versionCheck
: boolean
;
} = dashboardConfigSchema
Allows customization of the Dashboard Configuration
features.dashboardConfig.dashboardEnabled
Section titled “features.dashboardConfig.dashboardEnabled”boolean
= ...
OPTIONAL - This allows the user to enable or disable the Astro StudioCMS dashboard but still provide all the helper’s and utilities to those who are customizing their setup, doing so will disable the dashboard and you will need to manage your content via your database
Default
true
features.dashboardConfig.dashboardRouteOverride?
Section titled “features.dashboardConfig.dashboardRouteOverride?”string
= ...
OPTIONAL - This allows the user to override the default dashboard route to a custom route
Note: Use with caution, this is an advanced feature
Usage
- The default route is
dashboard
without any/
or\
characters. If you want to override the route to/admin
you would set this value toadmin
Default
"dashboard"
features.dashboardConfig.faviconURL
Section titled “features.dashboardConfig.faviconURL”string
= ...
OPTIONAL - This allows the user to override the default Favicon URL to a custom URL
features.dashboardConfig.inject404Route
Section titled “features.dashboardConfig.inject404Route”boolean
= ...
OPTIONAL - This allows the user to enable or disable the default 404 route for the dashboard
Default
true
features.dashboardConfig.versionCheck
Section titled “features.dashboardConfig.versionCheck”boolean
= ...
OPTIONAL - This allows the user to enable or disable the version check for the dashboard
This will check for the latest version of StudioCMS and notify the user if there is a new version available.
Default
true
features.developerConfig
Section titled “features.developerConfig”{
demoMode
: | false
| {
password
: string
;
username
: string
;
};
} = developerConfigSchema
Developer Options/Configuration
features.developerConfig.demoMode
Section titled “features.developerConfig.demoMode”| false
| {
password
: string
;
username
: string
;
} = ...
Enable demo mode for the site
If set to an object, the site will be in demo mode, and the user will be able to login with the provided username and password.
Default
false
Example
{ demoMode: { username: "demo_user", password: "some-demo-password" }}
features.injectQuickActionsMenu
Section titled “features.injectQuickActionsMenu”boolean
= ...
Enable Quick Actions Menu - Whether to enable the quick actions menu which allows easy access to your dashboard while logged in on non-dashboard pages.
Default
true
features.preferredImageService?
Section titled “features.preferredImageService?”string
= ...
Set the identifier of the Preferred Image Service
Requires an Image Service to be installed such as ‘cloudinary-js’
features.robotsTXT
Section titled “features.robotsTXT”| boolean
| {
host
: string
| boolean
;
policy
: {
allow
: string
| string
[];
cleanParam
: string
| string
[];
crawlDelay
: number
;
disallow
: string
| string
[];
userAgent
: | "*"
| "360Spider"
| "360Spider-Image"
| "360Spider-Video"
| "HaoSouSpider"
| "AdsBot-Google"
| "AdsBot-Google-Mobile"
| "AdsBot-Google-Mobile-Apps"
| "Googlebot"
| "Googlebot-Image"
| "Googlebot-Mobile"
| "Googlebot-News"
| "Googlebot-Video"
| "Mediapartners-Google"
| "adidxbot"
| "bingbot"
| "BingPreview"
| "MicrosoftPreview"
| "msnbot"
| "msnbot-media"
| "Applebot"
| "AppleNewsBot"
| "Baiduspider"
| "Baiduspider-image"
| "Baiduspider-mobile"
| "Baiduspider-news"
| "Baiduspider-video"
| "coccoc"
| "coccocbot-image"
| "coccocbot-web"
| "DuckDuckBot"
| "DuckDuckGo-Favicons-Bot"
| "facebookcatalog"
| "facebookexternalhit"
| "Facebot"
| "gooblog"
| "ichiro"
| "Sogou blog"
| "Sogou inst spider"
| "Sogou News Spider"
| "Sogou Orion spider"
| "Sogou spider2"
| "Sogou web spider"
| "Yandex"
| "YandexMobileBot"
| "Algolia Crawler"
| "BublupBot"
| "CCBot"
| "Cliqzbot"
| "Daumoa"
| "DeuSu"
| "EuripBot"
| "Exploratodo"
| "Feedly"
| "Findxbot"
| "istellabot"
| "JikeSpider"
| "Lycos"
| "Mail.Ru"
| "MojeekBot"
| "OrangeBot"
| "Pinterest"
| "Plukkie"
| "Qwantify"
| "Rambler"
| "SemanticScholarBot"
| "SeznamBot"
| "Sosospider"
| "Slurp"
| "Twitterbot"
| "WhatsApp"
| "yacybot"
| "YepBot"
| "Yeti"
| "YioopBot"
| "yoozBot"
| "YoudaoBot"
| (
| "*"
| "360Spider"
| "360Spider-Image"
| "360Spider-Video"
| "HaoSouSpider"
| "AdsBot-Google"
| "AdsBot-Google-Mobile"
| "AdsBot-Google-Mobile-Apps"
| "Googlebot"
| "Googlebot-Image"
| "Googlebot-Mobile"
| "Googlebot-News"
| "Googlebot-Video"
| "Mediapartners-Google"
| "adidxbot"
| "bingbot"
| "BingPreview"
| "MicrosoftPreview"
| "msnbot"
| "msnbot-media"
| "Applebot"
| "AppleNewsBot"
| "Baiduspider"
| "Baiduspider-image"
| "Baiduspider-mobile"
| "Baiduspider-news"
| "Baiduspider-video"
| "coccoc"
| "coccocbot-image"
| "coccocbot-web"
| "DuckDuckBot"
| "DuckDuckGo-Favicons-Bot"
| "facebookcatalog"
| "facebookexternalhit"
| "Facebot"
| "gooblog"
| "ichiro"
| "Sogou blog"
| "Sogou inst spider"
| "Sogou News Spider"
| "Sogou Orion spider"
| "Sogou spider2"
| "Sogou web spider"
| "Yandex"
| "YandexMobileBot"
| "Algolia Crawler"
| "BublupBot"
| "CCBot"
| "Cliqzbot"
| "Daumoa"
| "DeuSu"
| "EuripBot"
| "Exploratodo"
| "Feedly"
| "Findxbot"
| "istellabot"
| "JikeSpider"
| "Lycos"
| "Mail.Ru"
| "MojeekBot"
| "OrangeBot"
| "Pinterest"
| "Plukkie"
| "Qwantify"
| "Rambler"
| "SemanticScholarBot"
| "SeznamBot"
| "Sosospider"
| "Slurp"
| "Twitterbot"
| "WhatsApp"
| "yacybot"
| "YepBot"
| "Yeti"
| "YioopBot"
| "yoozBot"
| "YoudaoBot"
)[];
}[];
sitemap
: string
| boolean
| string
[];
} = ...
Allows the user to enable/disable the use of the StudioCMS Custom astro-robots-txt
Integration
Default
robotsTXT: { policy: [ { userAgent: ['*'], allow: ['/'], disallow: ['/dashboard/'] } ] }
features.sdk
Section titled “features.sdk”{
cacheConfig
: {
enabled
: boolean
;
lifetime
: number
;
};
} = SDKSchema
SDKSchema is a Zod schema that validates the SDK configuration. It can either be a boolean or an object containing cache configuration.
If it is a boolean, it defaults to true
and transforms into an object
with default cache configuration.
If it is an object, it must contain the cacheConfig
property which is
validated by the SDKCacheSchema
.
features.sdk.cacheConfig
Section titled “features.sdk.cacheConfig”{
enabled
: boolean
;
lifetime
: number
;
} = ProcessedCacheConfigSchema
Cache Configuration
Default
cacheConfig: { lifetime: '5m' }
features.sdk.cacheConfig.enabled
Section titled “features.sdk.cacheConfig.enabled”boolean
= ...
Cache Enabled
Default
true
features.sdk.cacheConfig.lifetime
Section titled “features.sdk.cacheConfig.lifetime”number
= ...
Cache Lifetime
{number}{unit}
- e.g. ‘5m’ for 5 minutes or ‘1h’ for 1 hour
Default
'5m'
locale
Section titled “locale”{
dateLocale
: string
;
dateTimeFormat
: DateTimeFormatOptions
;
} = ...
Locale specific settings
locale.dateLocale
Section titled “locale.dateLocale”string
= ...
Date Locale used for formatting dates
locale.dateTimeFormat
Section titled “locale.dateTimeFormat”DateTimeFormatOptions
= ...
DateTime Format Options
logLevel
Section titled “logLevel”"All"
| "Fatal"
| "Error"
| "Warning"
| "Info"
| "Debug"
| "Trace"
| "None"
= ...
Set the LogLevel for Effect based code
plugins?
Section titled “plugins?”StudioCMSPlugin
[] = ...
Add Plugins to the StudioCMS
verbose
Section titled “verbose”boolean
= ...
Whether to show verbose output
Default
false
Returns
Section titled “Returns”string
The resulting configuration file content as a string with the options embedded.
buildVirtualModules()
Section titled “buildVirtualModules()”function buildVirtualModules(resolve: (...path: string[]) => string): { ambientScripts: (items: string[]) => string; astroComponentVirtual: (items: Record<string, string>) => string; dynamicVirtual: (items: string[]) => string; dynamicWithAstroVirtual: (__namedParameters: { astroComponents: Record<string, string>; dynamicExports: string[]; }) => string; namedVirtual: (__namedParameters: { exportDefault: boolean; namedExport: string; path: string; }) => string;}
Defined in: studiocms/packages/studiocms/src/virtuals/utils.ts:50^
Factory function to build utilities for generating virtual module code strings.
Parameters
Section titled “Parameters”resolve
Section titled “resolve”(…path
: string
[]) => string
A function that resolves a list of path segments into a string path.
Returns
Section titled “Returns”{ ambientScripts: (items: string[]) => string; astroComponentVirtual: (items: Record<string, string>) => string; dynamicVirtual: (items: string[]) => string; dynamicWithAstroVirtual: (__namedParameters: { astroComponents: Record<string, string>; dynamicExports: string[]; }) => string; namedVirtual: (__namedParameters: { exportDefault: boolean; namedExport: string; path: string; }) => string;}
An object containing utilities for generating virtual module code:
dynamicVirtual
: Generates export statements for a list of module paths.ambientScripts
: Generates import statements for a list of module paths (for side effects).namedVirtual
: Generates code to re-export a named export (and optionally as default) from a module.astroComponentVirtual
: Generates export statements for Astro components with custom names.dynamicWithAstroVirtual
: Generates combined exports for dynamic modules and Astro components.
ambientScripts()
Section titled “ambientScripts()”ambientScripts: (items: string[]) => string;
Generates import statements for a list of module paths (for side effects).
Parameters
Section titled “Parameters”string
[]
Returns
Section titled “Returns”string
astroComponentVirtual()
Section titled “astroComponentVirtual()”astroComponentVirtual: (items: Record<string, string>) => string;
Generates export statements for Astro components with custom names.
Parameters
Section titled “Parameters”Record
<string
, string
>
Returns
Section titled “Returns”string
dynamicVirtual()
Section titled “dynamicVirtual()”dynamicVirtual: (items: string[]) => string;
Generates export statements for a list of module paths.
Parameters
Section titled “Parameters”string
[]
Returns
Section titled “Returns”string
dynamicWithAstroVirtual()
Section titled “dynamicWithAstroVirtual()”dynamicWithAstroVirtual: (__namedParameters: { astroComponents: Record<string, string>; dynamicExports: string[]; }) => string;
Generates combined exports for dynamic modules and Astro components.
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”astroComponents
Section titled “astroComponents”Record
<string
, string
>
dynamicExports
Section titled “dynamicExports”string
[]
Returns
Section titled “Returns”string
namedVirtual()
Section titled “namedVirtual()”namedVirtual: (__namedParameters: { exportDefault: boolean; namedExport: string; path: string; }) => string;
Generates code to re-export a named export (and optionally as default) from a module.
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”exportDefault?
Section titled “exportDefault?”boolean
namedExport
Section titled “namedExport”string
string
Returns
Section titled “Returns”string