URL handler options

interface UrlOptions {
    alias?: Record<string, string>;
    assetDir?: string;
    hash?: string | boolean;
    inline?: boolean;
    publicPath?: string;
    resolve?: UrlResolve;
}

Properties

alias?: Record<string, string>

Aliases for URL paths. Overrides the global alias option.

  • ex.: {"foo":"bar"}
assetDir?: string

Directory path for outputted CSS assets, which is not included into resulting URL

"."
hash?: string | boolean

Enable/disable name generation with hash for outputted CSS assets or provide your own placeholder with the following blocks:

  • [extname]: The file extension of the asset including a leading dot, e.g. .png.
  • [ext]: The file extension without a leading dot, e.g. png.
  • [hash(:<num>)]: A hash based on the name and content of the asset (with optional length).
  • [name]: The file name of the asset excluding any extension.

Forward slashes / can be used to place files in sub-directories.

"assets/[name]-[hash][extname]" ("assets/[name][extname]" if false)
inline?: boolean

Inline files instead of copying

true for inject mode, otherwise false

publicPath?: string

Public Path for URLs in CSS files

"./"
resolve?: UrlResolve

Provide custom resolver for URLs in place of the default one