vite-plugin-public-path
Version:
Vite's equivalent of `__webpack_public_path__` in Webpack. Works for `index.html` and modern/legacy build.
12 lines (11 loc) • 553 B
TypeScript
import { ViteConfig, Options } from "..";
/**
* Modern build of JS files import other chunks with relative path, but preload dependencies
* and load CSS files with root-relative paths.
*
* Legacy build of JS files import other chunks with root-relative paths and embedding CSS files
* in JS code. The root-relative URLs in embedded CSS files could be hard to replace.
*
* So we replace them with SWC's AST traversal.
*/
export declare function processCode(config: ViteConfig, options: Options, _fileName: string, code: string): Promise<string>;