UNPKG

nuxt

Version:

Nuxt is a free and open-source framework with an intuitive and extendable way to create type-safe, performant and production-grade full-stack web applications and websites with Vue.js.

17 lines (16 loc) 570 B
import { joinRelativeURL } from "ufo"; import { useRuntimeConfig } from "nitropack/runtime"; export function baseURL() { return useRuntimeConfig().app.baseURL; } export function buildAssetsDir() { return useRuntimeConfig().app.buildAssetsDir; } export function buildAssetsURL(...path) { return joinRelativeURL(publicAssetsURL(), buildAssetsDir(), ...path); } export function publicAssetsURL(...path) { const app = useRuntimeConfig().app; const publicBase = app.cdnURL || app.baseURL; return path.length ? joinRelativeURL(publicBase, ...path) : publicBase; }