import { resolve, join } from 'pathe' import { existsSync, readdirSync } from 'fs' import defu from 'defu' export default { /** * Vue.js config * @version 2 * @version 3 */ vue: { /** * Properties that will be set directly on `Vue.config` for vue@2. * * @see [vue@2 Documentation](https://v2.vuejs.org/v2/api/#Global-Config) * @type {import('vue/types/vue').VueConfiguration} * @version 2 */ config: { silent: { $resolve: (val, get) => val ?? !get('dev') }, performance: { $resolve: (val, get) => val ?? get('dev') }, }, /** * Options for the Vue compiler that will be passed at build time * @see [documentation](https://vuejs.org/api/application.html#app-config-compileroptions) * @type {import('@vue/compiler-core').CompilerOptions} * @version 3 */ compilerOptions: {} }, /** * Nuxt App configuration. * @version 2 * @version 3 */ app: { /** * The base path of your Nuxt application. * * This can be set at runtime by setting the BASE_PATH environment variable. * @example * ```bash * BASE_PATH=/prefix/ node .output/server/index.mjs * ``` */ baseURL: '/', /** The folder name for the built site assets, relative to `baseURL` (or `cdnURL` if set). This is set at build time and should not be customized at runtime. */ buildAssetsDir: '/_nuxt/', /** * The folder name for the built site assets, relative to `baseURL` (or `cdnURL` if set). * @deprecated - use `buildAssetsDir` instead * @version 2 */ assetsPath: { $resolve: (val, get) => val ?? get('buildAssetsDir') }, /** * An absolute URL to serve the public folder from (production-only). * * This can be set to a different value at runtime by setting the CDN_URL environment variable. * @example * ```bash * CDN_URL=https://mycdn.org/ node .output/server/index.mjs * ``` */ cdnURL: { $resolve: (val, get) => get('dev') ? null : val || null }, /** * Set default configuration for `
` on every page. * * @example * ```js * app: { * head: { * meta: [ * // * { name: 'viewport', content: 'width=device-width, initial-scale=1' } * ], * script: [ * // * { src: 'https://awesome-lib.js' } * ], * link: [ * // * { rel: 'stylesheet', href: 'https://awesome-lib.css' } * ], * // please note that this is an area that is likely to change * style: [ * // * { children: ':root { color: red }', type: 'text/css' } * ] * } * } * ``` * @type {typeof import('../src/types/meta').MetaObject} * @version 3 */ head: { $resolve: (val, get) => { return defu(val, get('meta'), { meta: [], link: [], style: [], script: [] }) } }, }, /** * The path to a templated HTML file for rendering Nuxt responses. * Uses `