feat: init
This commit is contained in:
19
node_modules/@nuxt/nitro-server/dist/runtime/utils/paths.mjs
generated
vendored
Normal file
19
node_modules/@nuxt/nitro-server/dist/runtime/utils/paths.mjs
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { joinRelativeURL } from "ufo";
|
||||
import { useRuntimeConfig } from "nitropack/runtime";
|
||||
export function baseURL() {
|
||||
// TODO: support passing event to `useRuntimeConfig`
|
||||
return useRuntimeConfig().app.baseURL;
|
||||
}
|
||||
export function buildAssetsDir() {
|
||||
// TODO: support passing event to `useRuntimeConfig`
|
||||
return useRuntimeConfig().app.buildAssetsDir;
|
||||
}
|
||||
export function buildAssetsURL(...path) {
|
||||
return joinRelativeURL(publicAssetsURL(), buildAssetsDir(), ...path);
|
||||
}
|
||||
export function publicAssetsURL(...path) {
|
||||
// TODO: support passing event to `useRuntimeConfig`
|
||||
const app = useRuntimeConfig().app;
|
||||
const publicBase = app.cdnURL || app.baseURL;
|
||||
return path.length ? joinRelativeURL(publicBase, ...path) : publicBase;
|
||||
}
|
||||
Reference in New Issue
Block a user