/** * Options for setting up CDN assets mapping */ export type XarcCdnAssetsMappingOptions = { /** * isomorphic-loader extend require instance * * - if not provided, then the default instance is used */ extendRequire?: any; /** * assets mapping data * * - if not provided, then will try to load it from one of these files: * 1. dist/cdn-mappings.json * 2. config/assets.json * */ mapping?: Record; /** * Only setup in production mode (NODE_ENV === "production") */ prodOnly?: boolean; }; /** * Setup assets mapping to CDN URLs * * @param options - asset mapping options * @returns nothing */ export declare const setupIsomorphicCdnAssetsMapping: (options?: XarcCdnAssetsMappingOptions) => void; /** * Load the require hook to support isomorphic assets when doing SSR * * @param ignoreExtensions - when a require file is not found, and its extension is * in this, then it will be considered an isomorphic asset and an empty `{}` will * be returned for it to avoid failing with module not found errors. * - **Default** * `".css|.scss|.sass|.pcss|.stylus|.styl|.less|.sss|.gif|.jpeg|.jpg|.png|.svg|.mp4|.webm|.ogv|.aac|.mp3|.wav|.ogg"` * - set to `false` to disable this and let module not found error to throw * * @returns isomorphic require extender */ export declare function setupIsomorphicLoader(ignoreExtensions?: false | string | string[]): any; /** * Setup APP_SRC_DIR when running node.js server * * - `src/` in development mode * - `lib/` in production mode * * @returns nothing */ export declare function setupAppSrcDir(): void; /** * Available options for setting up run time support */ type XarcSupportOptions = { /** * - boolean: true to load @babel/register * - Object: options to be passed to @babel/register */ babelRegister?: any; /** * Set to false to avoid loading node.js require hook to handle isomorphic assets. */ isomorphicExtendRequire?: boolean; /** * Setup CDN mapping for isomorphic assets * * @remarks - if this is disabled, then any `import "style.css"` or `import "image.png"` * will result in syntax error or module not found error in node.js. */ isomorphicCdnOptions?: XarcCdnAssetsMappingOptions; /** * If true, then ensure everything is ready before resolving the returned promise. * * @remarks * In dev mode, resolving the promise depends on the app server starting and loading * the dev plugin. What this means is basically: * * ```js * const loadSupport = support.load({awaitReady: true}); * await startServer(); * await loadSupport; * * // do any other initialization that could trigger importing isomorphic assets * * ``` */ awaitReady?: boolean; }; /** * start node.js run time support for app server * * @param options - options on what runtime support to start * @returns Promise */ export declare function loadRuntimeSupport( /** * support load options or a callback for when support load is done */ options?: XarcSupportOptions): Promise; export {};