mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
refactor(schema): upgrade to untyped 0.5 (#7452)
This commit is contained in:
parent
9382b42d7b
commit
ceb61ada2b
@ -20,7 +20,7 @@
|
|||||||
"pathe": "^0.3.7",
|
"pathe": "^0.3.7",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"scule": "^0.3.2",
|
"scule": "^0.3.2",
|
||||||
"untyped": "^0.4.7",
|
"untyped": "^0.5.0",
|
||||||
"vue-mq": "^1.0.1",
|
"vue-mq": "^1.0.1",
|
||||||
"vue-plausible": "^1.3.2"
|
"vue-plausible": "^1.3.2"
|
||||||
},
|
},
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
"nuxt": "link:./packages/nuxt",
|
"nuxt": "link:./packages/nuxt",
|
||||||
"nuxt3": "link:./packages/nuxt",
|
"nuxt3": "link:./packages/nuxt",
|
||||||
"vite": "~3.1.0",
|
"vite": "~3.1.0",
|
||||||
"unbuild": "^0.8.10"
|
"unbuild": "^0.8.11"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nuxtjs/eslint-config-typescript": "^11.0.0",
|
"@nuxtjs/eslint-config-typescript": "^11.0.0",
|
||||||
@ -64,7 +64,7 @@
|
|||||||
"pathe": "^0.3.7",
|
"pathe": "^0.3.7",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"typescript": "^4.8.3",
|
"typescript": "^4.8.3",
|
||||||
"unbuild": "^0.8.10",
|
"unbuild": "^0.8.11",
|
||||||
"vitest": "~0.19.1",
|
"vitest": "~0.19.1",
|
||||||
"vue-tsc": "^0.39.5"
|
"vue-tsc": "^0.39.5"
|
||||||
},
|
},
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
"semver": "^7.3.7",
|
"semver": "^7.3.7",
|
||||||
"unctx": "^2.0.2",
|
"unctx": "^2.0.2",
|
||||||
"unimport": "^0.6.7",
|
"unimport": "^0.6.7",
|
||||||
"untyped": "^0.4.7"
|
"untyped": "^0.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/lodash.template": "^4",
|
"@types/lodash.template": "^4",
|
||||||
|
@ -46,5 +46,5 @@ export async function loadNuxtConfig (opts: LoadNuxtConfigOptions): Promise<Nuxt
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Resolve and apply defaults
|
// Resolve and apply defaults
|
||||||
return applyDefaults(NuxtConfigSchema, nuxtConfig) as NuxtOptions
|
return await applyDefaults(NuxtConfigSchema, nuxtConfig) as NuxtOptions
|
||||||
}
|
}
|
||||||
|
@ -30,12 +30,12 @@ export function defineNuxtModule<OptionsT extends ModuleOptions> (definition: Mo
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Resolves module options from inline options, [configKey] in nuxt.config, defaults and schema
|
// Resolves module options from inline options, [configKey] in nuxt.config, defaults and schema
|
||||||
function getOptions (inlineOptions?: OptionsT, nuxt: Nuxt = useNuxt()) {
|
async function getOptions (inlineOptions?: OptionsT, nuxt: Nuxt = useNuxt()) {
|
||||||
const configKey = definition.meta!.configKey || definition.meta!.name!
|
const configKey = definition.meta!.configKey || definition.meta!.name!
|
||||||
const _defaults = definition.defaults instanceof Function ? definition.defaults(nuxt) : definition.defaults
|
const _defaults = definition.defaults instanceof Function ? definition.defaults(nuxt) : definition.defaults
|
||||||
let _options = defu(inlineOptions, nuxt.options[configKey as keyof NuxtOptions], _defaults) as OptionsT
|
let _options = defu(inlineOptions, nuxt.options[configKey as keyof NuxtOptions], _defaults) as OptionsT
|
||||||
if (definition.schema) {
|
if (definition.schema) {
|
||||||
_options = applyDefaults(definition.schema, _options) as OptionsT
|
_options = await applyDefaults(definition.schema, _options) as OptionsT
|
||||||
}
|
}
|
||||||
return Promise.resolve(_options)
|
return Promise.resolve(_options)
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@
|
|||||||
"unenv": "^0.6.2",
|
"unenv": "^0.6.2",
|
||||||
"unimport": "^0.6.7",
|
"unimport": "^0.6.7",
|
||||||
"unplugin": "^0.9.2",
|
"unplugin": "^0.9.2",
|
||||||
"untyped": "^0.4.7",
|
"untyped": "^0.5.0",
|
||||||
"vue": "^3.2.39",
|
"vue": "^3.2.39",
|
||||||
"vue-bundle-renderer": "^0.4.2",
|
"vue-bundle-renderer": "^0.4.2",
|
||||||
"vue-devtools-stub": "^0.1.0",
|
"vue-devtools-stub": "^0.1.0",
|
||||||
|
@ -114,7 +114,7 @@ export { }
|
|||||||
const adHocModules = ['router', 'pages', 'imports', 'meta', 'components']
|
const adHocModules = ['router', 'pages', 'imports', 'meta', 'components']
|
||||||
export const schemaTemplate: NuxtTemplate<TemplateContext> = {
|
export const schemaTemplate: NuxtTemplate<TemplateContext> = {
|
||||||
filename: 'types/schema.d.ts',
|
filename: 'types/schema.d.ts',
|
||||||
getContents: ({ nuxt }) => {
|
getContents: async ({ nuxt }) => {
|
||||||
const moduleInfo = nuxt.options._installedModules.map(m => ({
|
const moduleInfo = nuxt.options._installedModules.map(m => ({
|
||||||
...m.meta || {},
|
...m.meta || {},
|
||||||
importName: m.entryPath || m.meta?.name
|
importName: m.entryPath || m.meta?.name
|
||||||
@ -128,7 +128,7 @@ export const schemaTemplate: NuxtTemplate<TemplateContext> = {
|
|||||||
` [${genString(meta.configKey)}]?: typeof ${genDynamicImport(meta.importName, { wrapper: false })}.default extends NuxtModule<infer O> ? Partial<O> : Record<string, any>`
|
` [${genString(meta.configKey)}]?: typeof ${genDynamicImport(meta.importName, { wrapper: false })}.default extends NuxtModule<infer O> ? Partial<O> : Record<string, any>`
|
||||||
),
|
),
|
||||||
' }',
|
' }',
|
||||||
generateTypes(resolveSchema(Object.fromEntries(Object.entries(nuxt.options.runtimeConfig).filter(([key]) => key !== 'public'))),
|
generateTypes(await resolveSchema(Object.fromEntries(Object.entries(nuxt.options.runtimeConfig).filter(([key]) => key !== 'public'))),
|
||||||
{
|
{
|
||||||
interfaceName: 'RuntimeConfig',
|
interfaceName: 'RuntimeConfig',
|
||||||
addExport: false,
|
addExport: false,
|
||||||
@ -136,7 +136,7 @@ export const schemaTemplate: NuxtTemplate<TemplateContext> = {
|
|||||||
allowExtraKeys: false,
|
allowExtraKeys: false,
|
||||||
indentation: 2
|
indentation: 2
|
||||||
}),
|
}),
|
||||||
generateTypes(resolveSchema(nuxt.options.runtimeConfig.public),
|
generateTypes(await resolveSchema(nuxt.options.runtimeConfig.public),
|
||||||
{
|
{
|
||||||
interfaceName: 'PublicRuntimeConfig',
|
interfaceName: 'PublicRuntimeConfig',
|
||||||
addExport: false,
|
addExport: false,
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
"@types/lodash.template": "^4",
|
"@types/lodash.template": "^4",
|
||||||
"@types/semver": "^7",
|
"@types/semver": "^7",
|
||||||
"unbuild": "latest",
|
"unbuild": "latest",
|
||||||
"untyped": "^0.4.7",
|
"untyped": "^0.5.0",
|
||||||
"vite": "~3.1.0"
|
"vite": "~3.1.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -15,7 +15,7 @@ export default defineUntypedSchema({
|
|||||||
* @version 3
|
* @version 3
|
||||||
*/
|
*/
|
||||||
components: {
|
components: {
|
||||||
$resolve: (val, get) => {
|
$resolve: (val) => {
|
||||||
if (Array.isArray(val)) {
|
if (Array.isArray(val)) {
|
||||||
return { dirs: val }
|
return { dirs: val }
|
||||||
}
|
}
|
||||||
|
@ -21,10 +21,10 @@ export default defineUntypedSchema({
|
|||||||
*/
|
*/
|
||||||
config: {
|
config: {
|
||||||
silent: {
|
silent: {
|
||||||
$resolve: (val, get) => val ?? !get('dev')
|
$resolve: async (val, get) => val ?? !(await get('dev'))
|
||||||
},
|
},
|
||||||
performance: {
|
performance: {
|
||||||
$resolve: (val, get) => val ?? get('dev')
|
$resolve: async (val, get) => val ?? await get('dev')
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -62,7 +62,7 @@ export default defineUntypedSchema({
|
|||||||
* @version 2
|
* @version 2
|
||||||
*/
|
*/
|
||||||
assetsPath: {
|
assetsPath: {
|
||||||
$resolve: (val, get) => val ?? get('buildAssetsDir')
|
$resolve: async (val, get) => val ?? (await get('buildAssetsDir'))
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* An absolute URL to serve the public folder from (production-only).
|
* An absolute URL to serve the public folder from (production-only).
|
||||||
@ -74,7 +74,7 @@ export default defineUntypedSchema({
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
cdnURL: {
|
cdnURL: {
|
||||||
$resolve: (val, get) => get('dev') ? '' : (process.env.NUXT_APP_CDN_URL ?? val) || ''
|
$resolve: async (val, get) => (await get('dev')) ? '' : (process.env.NUXT_APP_CDN_URL ?? val) || ''
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Set default configuration for `<head>` on every page.
|
* Set default configuration for `<head>` on every page.
|
||||||
@ -111,8 +111,8 @@ export default defineUntypedSchema({
|
|||||||
* @version 3
|
* @version 3
|
||||||
*/
|
*/
|
||||||
head: {
|
head: {
|
||||||
$resolve: (val, get) => {
|
$resolve: async (val, get) => {
|
||||||
const resolved: Required<MetaObject> = defu(val, get('meta'), {
|
const resolved: Required<MetaObject> = defu(val, await get('meta'), {
|
||||||
meta: [],
|
meta: [],
|
||||||
link: [],
|
link: [],
|
||||||
style: [],
|
style: [],
|
||||||
@ -181,14 +181,14 @@ export default defineUntypedSchema({
|
|||||||
* @version 2
|
* @version 2
|
||||||
*/
|
*/
|
||||||
appTemplatePath: {
|
appTemplatePath: {
|
||||||
$resolve: (val, get) => {
|
$resolve: async (val, get) => {
|
||||||
if (val) {
|
if (val) {
|
||||||
return resolve(get('srcDir'), val)
|
return resolve(await get('srcDir'), val)
|
||||||
}
|
}
|
||||||
if (existsSync(join(get('srcDir'), 'app.html'))) {
|
if (existsSync(join(await get('srcDir'), 'app.html'))) {
|
||||||
return join(get('srcDir'), 'app.html')
|
return join(await get('srcDir'), 'app.html')
|
||||||
}
|
}
|
||||||
return resolve(get('buildDir'), 'views/app.template.html')
|
return resolve(await get('buildDir'), 'views/app.template.html')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -199,9 +199,9 @@ export default defineUntypedSchema({
|
|||||||
* @version 2
|
* @version 2
|
||||||
*/
|
*/
|
||||||
store: {
|
store: {
|
||||||
$resolve: (val, get) => val !== false &&
|
$resolve: async (val, get) => val !== false &&
|
||||||
existsSync(join(get('srcDir'), get('dir.store'))) &&
|
existsSync(join(await get('srcDir'), await get('dir.store'))) &&
|
||||||
readdirSync(join(get('srcDir'), get('dir.store')))
|
readdirSync(join(await get('srcDir'), await get('dir.store')))
|
||||||
.find(filename => filename !== 'README.md' && filename[0] !== '.')
|
.find(filename => filename !== 'README.md' && filename[0] !== '.')
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -378,15 +378,15 @@ export default defineUntypedSchema({
|
|||||||
* @version 2
|
* @version 2
|
||||||
*/
|
*/
|
||||||
loadingIndicator: {
|
loadingIndicator: {
|
||||||
$resolve: (val, get) => {
|
$resolve: async (val, get) => {
|
||||||
val = typeof val === 'string' ? { name: val } : val
|
val = typeof val === 'string' ? { name: val } : val
|
||||||
return defu(val, {
|
return defu(val, {
|
||||||
name: 'default',
|
name: 'default',
|
||||||
color: get('loading.color') || '#D3D3D3',
|
color: await get('loading.color') || '#D3D3D3',
|
||||||
color2: '#F5F5F5',
|
color2: '#F5F5F5',
|
||||||
background: (get('manifest') && get('manifest.theme_color')) || 'white',
|
background: (await get('manifest') && await get('manifest.theme_color')) || 'white',
|
||||||
dev: get('dev'),
|
dev: await get('dev'),
|
||||||
loading: get('messages.loading')
|
loading: await get('messages.loading')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -402,12 +402,12 @@ export default defineUntypedSchema({
|
|||||||
* @version 2
|
* @version 2
|
||||||
*/
|
*/
|
||||||
pageTransition: {
|
pageTransition: {
|
||||||
$resolve: (val, get) => {
|
$resolve: async (val, get) => {
|
||||||
val = typeof val === 'string' ? { name: val } : val
|
val = typeof val === 'string' ? { name: val } : val
|
||||||
return defu(val, {
|
return defu(val, {
|
||||||
name: 'page',
|
name: 'page',
|
||||||
mode: 'out-in',
|
mode: 'out-in',
|
||||||
appear: get('render.ssr') === false || Boolean(val),
|
appear: await get('render.ssr') === false || Boolean(val),
|
||||||
appearClass: 'appear',
|
appearClass: 'appear',
|
||||||
appearActiveClass: 'appear-active',
|
appearActiveClass: 'appear-active',
|
||||||
appearToClass: 'appear-to'
|
appearToClass: 'appear-to'
|
||||||
|
@ -82,7 +82,7 @@ export default defineUntypedSchema({
|
|||||||
* @version 3
|
* @version 3
|
||||||
*/
|
*/
|
||||||
srcDir: {
|
srcDir: {
|
||||||
$resolve: (val, get) => resolve(get('rootDir'), val || '.')
|
$resolve: async (val, get) => resolve(await get('rootDir'), val || '.')
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -101,7 +101,7 @@ export default defineUntypedSchema({
|
|||||||
* @version 3
|
* @version 3
|
||||||
*/
|
*/
|
||||||
buildDir: {
|
buildDir: {
|
||||||
$resolve: (val, get) => resolve(get('rootDir'), val || '.nuxt')
|
$resolve: async (val, get) => resolve(await get('rootDir'), val || '.nuxt')
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -126,7 +126,7 @@ export default defineUntypedSchema({
|
|||||||
* @version 2
|
* @version 2
|
||||||
*/
|
*/
|
||||||
debug: {
|
debug: {
|
||||||
$resolve: (val, get) => val ?? get('dev')
|
$resolve: async (val, get) => val ?? await get('dev')
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -207,7 +207,7 @@ export default defineUntypedSchema({
|
|||||||
* @deprecated use `ssr` option
|
* @deprecated use `ssr` option
|
||||||
*/
|
*/
|
||||||
mode: {
|
mode: {
|
||||||
$resolve: (val, get) => val || (get('ssr') ? 'spa' : 'universal'),
|
$resolve: async (val, get) => val || ((await get('ssr')) ? 'spa' : 'universal'),
|
||||||
$schema: { deprecated: '`mode` option is deprecated' }
|
$schema: { deprecated: '`mode` option is deprecated' }
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -446,8 +446,8 @@ export default defineUntypedSchema({
|
|||||||
*/
|
*/
|
||||||
modulesDir: {
|
modulesDir: {
|
||||||
$default: ['node_modules'],
|
$default: ['node_modules'],
|
||||||
$resolve: (val, get) => [
|
$resolve: async (val, get) => [
|
||||||
...val.map((dir: string) => resolve(get('rootDir'), dir)),
|
...await Promise.all(val.map(async (dir: string) => resolve(await get('rootDir'), dir))),
|
||||||
resolve(process.cwd(), 'node_modules')
|
resolve(process.cwd(), 'node_modules')
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -494,12 +494,12 @@ export default defineUntypedSchema({
|
|||||||
* @version 3
|
* @version 3
|
||||||
*/
|
*/
|
||||||
public: {
|
public: {
|
||||||
$resolve: (val, get) => val || get('dir.static') || 'public',
|
$resolve: async (val, get) => val || await get('dir.static') || 'public',
|
||||||
},
|
},
|
||||||
/** @version 2 */
|
/** @version 2 */
|
||||||
static: {
|
static: {
|
||||||
$schema: { deprecated: 'use `dir.public` option instead' },
|
$schema: { deprecated: 'use `dir.public` option instead' },
|
||||||
$resolve: (val, get) => val || get('dir.public') || 'public',
|
$resolve: async (val, get) => val || await get('dir.public') || 'public',
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* The folder which will be used to auto-generate your Vuex store structure.
|
* The folder which will be used to auto-generate your Vuex store structure.
|
||||||
@ -570,13 +570,13 @@ export default defineUntypedSchema({
|
|||||||
* @version 3
|
* @version 3
|
||||||
*/
|
*/
|
||||||
alias: {
|
alias: {
|
||||||
$resolve: (val, get) => ({
|
$resolve: async (val, get) => ({
|
||||||
'~~': get('rootDir'),
|
'~~': await get('rootDir'),
|
||||||
'@@': get('rootDir'),
|
'@@': await get('rootDir'),
|
||||||
'~': get('srcDir'),
|
'~': await get('srcDir'),
|
||||||
'@': get('srcDir'),
|
'@': await get('srcDir'),
|
||||||
[get('dir.assets')]: join(get('srcDir'), get('dir.assets')),
|
[await get('dir.assets')]: join(await get('srcDir'), await get('dir.assets')),
|
||||||
[get('dir.public')]: join(get('srcDir'), get('dir.public')),
|
[await get('dir.public')]: join(await get('srcDir'), await get('dir.public')),
|
||||||
...val
|
...val
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -612,11 +612,11 @@ export default defineUntypedSchema({
|
|||||||
* @version 3
|
* @version 3
|
||||||
*/
|
*/
|
||||||
ignore: {
|
ignore: {
|
||||||
$resolve: (val, get) => [
|
$resolve: async (val, get) => [
|
||||||
'**/*.stories.{js,ts,jsx,tsx}', // ignore storybook files
|
'**/*.stories.{js,ts,jsx,tsx}', // ignore storybook files
|
||||||
'**/*.{spec,test}.{js,ts,jsx,tsx}', // ignore tests
|
'**/*.{spec,test}.{js,ts,jsx,tsx}', // ignore tests
|
||||||
'.output',
|
'.output',
|
||||||
get('ignorePrefix') && `**/${get('ignorePrefix')}*.*`
|
await get('ignorePrefix') && `**/${await get('ignorePrefix')}*.*`
|
||||||
].concat(val).filter(Boolean)
|
].concat(val).filter(Boolean)
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -636,9 +636,9 @@ export default defineUntypedSchema({
|
|||||||
* @version 2
|
* @version 2
|
||||||
*/
|
*/
|
||||||
watch: {
|
watch: {
|
||||||
$resolve: (val, get) => {
|
$resolve: async (val, get) => {
|
||||||
const rootDir = get('rootDir')
|
const rootDir = await get('rootDir')
|
||||||
return Array.from(new Set([].concat(val, get('_nuxtConfigFiles'))
|
return Array.from(new Set([].concat(val, await get('_nuxtConfigFiles'))
|
||||||
.filter(Boolean).map(p => resolve(rootDir, p))
|
.filter(Boolean).map(p => resolve(rootDir, p))
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
@ -740,14 +740,14 @@ export default defineUntypedSchema({
|
|||||||
* @version 3
|
* @version 3
|
||||||
*/
|
*/
|
||||||
runtimeConfig: {
|
runtimeConfig: {
|
||||||
$resolve: (val: RuntimeConfig, get) => defu(val, {
|
$resolve: async (val: RuntimeConfig, get) => defu(val, {
|
||||||
...get('publicRuntimeConfig'),
|
...await get('publicRuntimeConfig'),
|
||||||
...get('privateRuntimeConfig'),
|
...await get('privateRuntimeConfig'),
|
||||||
public: get('publicRuntimeConfig'),
|
public: await get('publicRuntimeConfig'),
|
||||||
app: {
|
app: {
|
||||||
baseURL: get('app').baseURL,
|
baseURL: (await get('app')).baseURL,
|
||||||
buildAssetsDir: get('app').buildAssetsDir,
|
buildAssetsDir: (await get('app')).buildAssetsDir,
|
||||||
cdnURL: get('app').cdnURL,
|
cdnURL: (await get('app')).cdnURL,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -12,7 +12,7 @@ export default defineUntypedSchema({
|
|||||||
* @version 3
|
* @version 3
|
||||||
*/
|
*/
|
||||||
builder: {
|
builder: {
|
||||||
$resolve: (val, get) => {
|
$resolve: async (val, get) => {
|
||||||
if (typeof val === 'object') {
|
if (typeof val === 'object') {
|
||||||
return val
|
return val
|
||||||
}
|
}
|
||||||
@ -20,7 +20,7 @@ export default defineUntypedSchema({
|
|||||||
vite: '@nuxt/vite-builder',
|
vite: '@nuxt/vite-builder',
|
||||||
webpack: '@nuxt/webpack-builder',
|
webpack: '@nuxt/webpack-builder',
|
||||||
}
|
}
|
||||||
return map[val] || (get('vite') === false ? map.webpack : map.vite)
|
return map[val] || (await get('vite') === false ? map.webpack : map.vite)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -30,13 +30,13 @@ export default defineUntypedSchema({
|
|||||||
* @version 3
|
* @version 3
|
||||||
*/
|
*/
|
||||||
sourcemap: {
|
sourcemap: {
|
||||||
$resolve: (val, get) => {
|
$resolve: async (val, get) => {
|
||||||
if (typeof val === 'boolean') {
|
if (typeof val === 'boolean') {
|
||||||
return { server: val, client: val }
|
return { server: val, client: val }
|
||||||
}
|
}
|
||||||
return defu(val, {
|
return defu(val, {
|
||||||
server: true,
|
server: true,
|
||||||
client: get('dev')
|
client: await get('dev')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -71,11 +71,11 @@ export default defineUntypedSchema({
|
|||||||
* @type {boolean | typeof import('webpack-bundle-analyzer').BundleAnalyzerPlugin.Options | typeof import('rollup-plugin-visualizer').PluginVisualizerOptions}
|
* @type {boolean | typeof import('webpack-bundle-analyzer').BundleAnalyzerPlugin.Options | typeof import('rollup-plugin-visualizer').PluginVisualizerOptions}
|
||||||
*/
|
*/
|
||||||
analyze: {
|
analyze: {
|
||||||
$resolve: (val, get) => {
|
$resolve: async (val, get) => {
|
||||||
if (val !== true) {
|
if (val !== true) {
|
||||||
return val ?? false
|
return val ?? false
|
||||||
}
|
}
|
||||||
const rootDir = get('rootDir')
|
const rootDir = await get('rootDir')
|
||||||
return {
|
return {
|
||||||
template: 'treemap',
|
template: 'treemap',
|
||||||
projectRoot: rootDir,
|
projectRoot: rootDir,
|
||||||
@ -150,7 +150,7 @@ export default defineUntypedSchema({
|
|||||||
* @version 2
|
* @version 2
|
||||||
*/
|
*/
|
||||||
cssSourceMap: {
|
cssSourceMap: {
|
||||||
$resolve: (val, get) => val ?? get('sourcemap') ?? get('dev')
|
$resolve: async (val, get) => val ?? await get('sourcemap') ?? await get('dev')
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -166,7 +166,7 @@ export default defineUntypedSchema({
|
|||||||
* @version 2
|
* @version 2
|
||||||
*/
|
*/
|
||||||
parallel: {
|
parallel: {
|
||||||
$resolve: (val, get) => get('build.extractCSS') ? false : Boolean(val)
|
$resolve: async (val, get) => await get('build.extractCSS') ? false : Boolean(val)
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -210,7 +210,7 @@ export default defineUntypedSchema({
|
|||||||
* @version 2
|
* @version 2
|
||||||
*/
|
*/
|
||||||
publicPath: {
|
publicPath: {
|
||||||
$resolve: (val, get) => val ? withTrailingSlash(normalizeURL(val)) : get('app').buildAssetsDir
|
$resolve: async (val, get) => val ? withTrailingSlash(normalizeURL(val)) : (await get('app').buildAssetsDir)
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -254,7 +254,7 @@ export default defineUntypedSchema({
|
|||||||
* @version 2
|
* @version 2
|
||||||
*/
|
*/
|
||||||
loaders: {
|
loaders: {
|
||||||
$resolve: (val, get) => {
|
$resolve: async (val, get) => {
|
||||||
const styleLoaders = [
|
const styleLoaders = [
|
||||||
'css', 'cssModules', 'less',
|
'css', 'cssModules', 'less',
|
||||||
'sass', 'scss', 'stylus', 'vueStyle'
|
'sass', 'scss', 'stylus', 'vueStyle'
|
||||||
@ -262,7 +262,7 @@ export default defineUntypedSchema({
|
|||||||
for (const name of styleLoaders) {
|
for (const name of styleLoaders) {
|
||||||
const loader = val[name]
|
const loader = val[name]
|
||||||
if (loader && loader.sourcemap === undefined) {
|
if (loader && loader.sourcemap === undefined) {
|
||||||
loader.sourcemap = Boolean(get('build.cssSourceMap'))
|
loader.sourcemap = Boolean(await get('build.cssSourceMap'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return val
|
return val
|
||||||
@ -272,14 +272,14 @@ export default defineUntypedSchema({
|
|||||||
imgUrl: { esModule: false, limit: 1000 },
|
imgUrl: { esModule: false, limit: 1000 },
|
||||||
pugPlain: {},
|
pugPlain: {},
|
||||||
vue: {
|
vue: {
|
||||||
productionMode: { $resolve: (val, get) => val ?? !get('dev') },
|
productionMode: { $resolve: async (val, get) => val ?? !(await get('dev')) },
|
||||||
transformAssetUrls: {
|
transformAssetUrls: {
|
||||||
video: 'src',
|
video: 'src',
|
||||||
source: 'src',
|
source: 'src',
|
||||||
object: 'src',
|
object: 'src',
|
||||||
embed: 'src'
|
embed: 'src'
|
||||||
},
|
},
|
||||||
compilerOptions: { $resolve: (val, get) => val ?? get('vue.compilerOptions') },
|
compilerOptions: { $resolve: async (val, get) => val ?? await get('vue.compilerOptions') },
|
||||||
},
|
},
|
||||||
css: {
|
css: {
|
||||||
importLoaders: 0,
|
importLoaders: 0,
|
||||||
@ -363,7 +363,7 @@ export default defineUntypedSchema({
|
|||||||
* @version 2
|
* @version 2
|
||||||
*/
|
*/
|
||||||
optimizeCSS: {
|
optimizeCSS: {
|
||||||
$resolve: (val, get) => val ?? (get('build.extractCSS') ? {} : false)
|
$resolve: async (val, get) => val ?? (await get('build.extractCSS') ? {} : false)
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -374,7 +374,7 @@ export default defineUntypedSchema({
|
|||||||
runtimeChunk: 'single',
|
runtimeChunk: 'single',
|
||||||
/** Set minimize to false to disable all minimizers. (It is disabled in development by default) */
|
/** Set minimize to false to disable all minimizers. (It is disabled in development by default) */
|
||||||
minimize: {
|
minimize: {
|
||||||
$resolve: (val, get) => val ?? !get('dev')
|
$resolve: async (val, get) => val ?? !(await get('dev'))
|
||||||
},
|
},
|
||||||
/** You can set minimizer to a customized array of plugins. */
|
/** You can set minimizer to a customized array of plugins. */
|
||||||
minimizer: undefined,
|
minimizer: undefined,
|
||||||
@ -475,7 +475,7 @@ export default defineUntypedSchema({
|
|||||||
*/
|
*/
|
||||||
presets: {},
|
presets: {},
|
||||||
cacheDirectory: {
|
cacheDirectory: {
|
||||||
$resolve: (val, get) => val ?? get('dev')
|
$resolve: async (val, get) => val ?? (await get('dev'))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -506,10 +506,10 @@ export default defineUntypedSchema({
|
|||||||
postcss: {
|
postcss: {
|
||||||
execute: undefined,
|
execute: undefined,
|
||||||
postcssOptions: {
|
postcssOptions: {
|
||||||
$resolve: (val, get) => {
|
$resolve: async (val, get) => {
|
||||||
// Ensure we return the same object in `build.postcss.postcssOptions as `postcss`
|
// Ensure we return the same object in `build.postcss.postcssOptions as `postcss`
|
||||||
// so modules which modify the configuration continue to work.
|
// so modules which modify the configuration continue to work.
|
||||||
const postcssOptions = get('postcss')
|
const postcssOptions = await get('postcss')
|
||||||
Object.assign(postcssOptions, defu(postcssOptions, val))
|
Object.assign(postcssOptions, defu(postcssOptions, val))
|
||||||
return postcssOptions
|
return postcssOptions
|
||||||
}
|
}
|
||||||
@ -625,7 +625,7 @@ export default defineUntypedSchema({
|
|||||||
* @version 2
|
* @version 2
|
||||||
*/
|
*/
|
||||||
stats: {
|
stats: {
|
||||||
$resolve: (val, get) => (val === 'none' || get('build.quiet')) ? false : val,
|
$resolve: async (val, get) => (val === 'none' || (await get('build.quiet'))) ? false : val,
|
||||||
excludeAssets: [
|
excludeAssets: [
|
||||||
/.map$/,
|
/.map$/,
|
||||||
/index\..+\.html$/,
|
/index\..+\.html$/,
|
||||||
|
@ -61,8 +61,8 @@ export default defineUntypedSchema({
|
|||||||
* @type {boolean | ((id?: string) => boolean)}
|
* @type {boolean | ((id?: string) => boolean)}
|
||||||
*/
|
*/
|
||||||
inlineSSRStyles: {
|
inlineSSRStyles: {
|
||||||
$resolve (val, get) {
|
async $resolve (val, get) {
|
||||||
if (val === false || get('dev') || get('ssr') === false || get('builder') === '@nuxt/webpack-builder') {
|
if (val === false || (await get('dev')) || (await get('ssr')) === false || (await get('builder')) === '@nuxt/webpack-builder') {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// Enabled by default for vite prod with ssr
|
// Enabled by default for vite prod with ssr
|
||||||
|
@ -10,7 +10,7 @@ export default <SchemaDefinition>{
|
|||||||
* Directory name that holds all the assets and generated pages for a `static` build.
|
* Directory name that holds all the assets and generated pages for a `static` build.
|
||||||
*/
|
*/
|
||||||
dir: {
|
dir: {
|
||||||
$resolve: (val = 'dist', get) => resolve(get('rootDir'), val)
|
$resolve: async (val = 'dist', get) => resolve((await get('rootDir')), val)
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -162,11 +162,11 @@ export default <SchemaDefinition>{
|
|||||||
* (payload, state and manifest files) will live.
|
* (payload, state and manifest files) will live.
|
||||||
*/
|
*/
|
||||||
base: {
|
base: {
|
||||||
$resolve: (val, get) => val || joinURL(get('app').buildAssetsDir, get('generate.dir'))
|
$resolve: async (val, get) => val || joinURL((await get('app')).buildAssetsDir, (await get('generate.dir')))
|
||||||
},
|
},
|
||||||
/** The full path to the versioned directory where static assets for the current build are located. */
|
/** The full path to the versioned directory where static assets for the current build are located. */
|
||||||
versionBase: {
|
versionBase: {
|
||||||
$resolve: (val, get) => val || joinURL(get('generate.base'), get('generate.version'))
|
$resolve: async (val, get) => val || joinURL((await get('generate.base')), (await get('generate.version')))
|
||||||
},
|
},
|
||||||
/** A unique string to uniquely identify payload versions (defaults to the current timestamp). */
|
/** A unique string to uniquely identify payload versions (defaults to the current timestamp). */
|
||||||
version: {
|
version: {
|
||||||
|
@ -19,13 +19,13 @@ export default defineUntypedSchema({
|
|||||||
* https://github.com/postcss/postcss-import
|
* https://github.com/postcss/postcss-import
|
||||||
*/
|
*/
|
||||||
'postcss-import': {
|
'postcss-import': {
|
||||||
$resolve: (val, get) => val !== false ? defu(val || {}, {
|
$resolve: async (val, get) => val !== false ? defu(val || {}, {
|
||||||
resolve: createResolver({
|
resolve: createResolver({
|
||||||
alias: { ...get('alias') },
|
alias: { ...(await get('alias')) },
|
||||||
modules: [
|
modules: [
|
||||||
get('srcDir'),
|
await get('srcDir'),
|
||||||
get('rootDir'),
|
await get('rootDir'),
|
||||||
...get('modulesDir')
|
...(await get('modulesDir'))
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
}) : val,
|
}) : val,
|
||||||
@ -42,7 +42,7 @@ export default defineUntypedSchema({
|
|||||||
autoprefixer: {},
|
autoprefixer: {},
|
||||||
|
|
||||||
cssnano: {
|
cssnano: {
|
||||||
$resolve: (val, get) => val ?? (!get('dev') && {
|
$resolve: async (val, get) => val ?? !(await get('dev') && {
|
||||||
preset: ['default', {
|
preset: ['default', {
|
||||||
// Keep quotes in font values to prevent from HEX conversion
|
// Keep quotes in font values to prevent from HEX conversion
|
||||||
// https://github.com/nuxt/nuxt.js/issues/6306
|
// https://github.com/nuxt/nuxt.js/issues/6306
|
||||||
|
@ -15,7 +15,7 @@ export default <SchemaDefinition>{
|
|||||||
shouldPreload: (_fileWithoutQuery: string, asType: string) => ['script', 'style'].includes(asType),
|
shouldPreload: (_fileWithoutQuery: string, asType: string) => ['script', 'style'].includes(asType),
|
||||||
/** enabled by default for development */
|
/** enabled by default for development */
|
||||||
runInNewContext: {
|
runInNewContext: {
|
||||||
$resolve: (val, get) => val ?? get('dev')
|
$resolve: async (val, get) => val ?? (await get('dev'))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ export default <SchemaDefinition>{
|
|||||||
* Set to `collapsed` to collapse the logs, or `false` to disable.
|
* Set to `collapsed` to collapse the logs, or `false` to disable.
|
||||||
*/
|
*/
|
||||||
ssrLog: {
|
ssrLog: {
|
||||||
$resolve: (val, get) => get('dev') ? Boolean(val) : false
|
$resolve: async (val, get) => (await get('dev')) ? Boolean(val) : false
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -213,7 +213,7 @@ export default <SchemaDefinition>{
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
csp: {
|
csp: {
|
||||||
$resolve: (val, get) => {
|
$resolve: async (val, get) => {
|
||||||
if (!val) { return false }
|
if (!val) { return false }
|
||||||
return {
|
return {
|
||||||
hashAlgorithm: 'sha256',
|
hashAlgorithm: 'sha256',
|
||||||
@ -230,7 +230,7 @@ export default <SchemaDefinition>{
|
|||||||
* if hashes are present. (Set option `unsafeInlineCompatibility` to true to
|
* if hashes are present. (Set option `unsafeInlineCompatibility` to true to
|
||||||
* disable this behavior.)
|
* disable this behavior.)
|
||||||
*/
|
*/
|
||||||
addMeta: Boolean(get('target') === 'static'),
|
addMeta: Boolean((await get('target')) === 'static'),
|
||||||
/**
|
/**
|
||||||
* Set option `unsafeInlineCompatibility` to `true` if you want both hashes and
|
* Set option `unsafeInlineCompatibility` to `true` if you want both hashes and
|
||||||
* 'unsafe-inline' for CSPv1 compatibility. In that case the `<meta>` tag will
|
* 'unsafe-inline' for CSPv1 compatibility. In that case the `<meta>` tag will
|
||||||
@ -239,7 +239,7 @@ export default <SchemaDefinition>{
|
|||||||
* HTTP response header.
|
* HTTP response header.
|
||||||
*/
|
*/
|
||||||
unsafeInlineCompatibility: false,
|
unsafeInlineCompatibility: false,
|
||||||
reportOnly: get('debug'),
|
reportOnly: (await get('debug')),
|
||||||
...val
|
...val
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,12 +33,12 @@ export default defineUntypedSchema({
|
|||||||
* @version 2
|
* @version 2
|
||||||
*/
|
*/
|
||||||
base: {
|
base: {
|
||||||
$resolve: (val, get) => val ? withTrailingSlash(normalizeURL(val)) : get('app').baseURL
|
$resolve: async (val, get) => val ? withTrailingSlash(normalizeURL(val)) : (await get('app')).baseURL
|
||||||
},
|
},
|
||||||
|
|
||||||
/** @private */
|
/** @private */
|
||||||
_routerBaseSpecified: {
|
_routerBaseSpecified: {
|
||||||
$resolve: (_val, get) => typeof get('router.base') === 'string'
|
$resolve: async (_val, get) => typeof (await get('router.base')) === 'string'
|
||||||
},
|
},
|
||||||
|
|
||||||
/** @version 2 */
|
/** @version 2 */
|
||||||
|
@ -14,15 +14,15 @@ export default defineUntypedSchema({
|
|||||||
*/
|
*/
|
||||||
vite: {
|
vite: {
|
||||||
root: {
|
root: {
|
||||||
$resolve: (val, get) => val ?? get('srcDir')
|
$resolve: async (val, get) => val ?? (await get('srcDir'))
|
||||||
},
|
},
|
||||||
mode: {
|
mode: {
|
||||||
$resolve: (val, get) => val ?? (get('dev') ? 'development' : 'production')
|
$resolve: async (val, get) => val ?? (await get('dev') ? 'development' : 'production')
|
||||||
},
|
},
|
||||||
logLevel: 'warn',
|
logLevel: 'warn',
|
||||||
define: {
|
define: {
|
||||||
$resolve: (val, get) => ({
|
$resolve: async (val, get) => ({
|
||||||
'process.dev': get('dev'),
|
'process.dev': await get('dev'),
|
||||||
...val || {}
|
...val || {}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -30,23 +30,23 @@ export default defineUntypedSchema({
|
|||||||
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
|
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
|
||||||
},
|
},
|
||||||
publicDir: {
|
publicDir: {
|
||||||
$resolve: (val, get) => val ?? resolve(get('srcDir'), get('dir').public)
|
$resolve: async (val, get) => val ?? resolve((await get('srcDir')), (await get('dir')).public)
|
||||||
},
|
},
|
||||||
vue: {
|
vue: {
|
||||||
isProduction: {
|
isProduction: {
|
||||||
$resolve: (val, get) => val ?? !get('dev')
|
$resolve: async (val, get) => val ?? !(await get('dev'))
|
||||||
},
|
},
|
||||||
template: {
|
template: {
|
||||||
compilerOptions: {
|
compilerOptions: {
|
||||||
$resolve: (val, get) => val ?? get('vue').compilerOptions
|
$resolve: async (val, get) => val ?? (await get('vue')).compilerOptions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
exclude: {
|
exclude: {
|
||||||
$resolve: (val, get) => [
|
$resolve: async (val, get) => [
|
||||||
...val || [],
|
...val || [],
|
||||||
...get('build.transpile').filter((i: string) => typeof i === 'string'),
|
...(await get('build.transpile')).filter((i: string) => typeof i === 'string'),
|
||||||
'vue-demi'
|
'vue-demi'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ export default defineUntypedSchema({
|
|||||||
clearScreen: false,
|
clearScreen: false,
|
||||||
build: {
|
build: {
|
||||||
assetsDir: {
|
assetsDir: {
|
||||||
$resolve: (val, get) => val ?? withoutLeadingSlash(get('app').buildAssetsDir)
|
$resolve: async (val, get) => val ?? withoutLeadingSlash((await get('app')).buildAssetsDir)
|
||||||
},
|
},
|
||||||
emptyOutDir: false
|
emptyOutDir: false
|
||||||
},
|
},
|
||||||
@ -67,11 +67,11 @@ export default defineUntypedSchema({
|
|||||||
fs: {
|
fs: {
|
||||||
strict: false,
|
strict: false,
|
||||||
allow: {
|
allow: {
|
||||||
$resolve: (val, get) => [
|
$resolve: async (val, get) => [
|
||||||
get('buildDir'),
|
await get('buildDir'),
|
||||||
get('srcDir'),
|
await get('srcDir'),
|
||||||
get('rootDir'),
|
await get('rootDir'),
|
||||||
...get('modulesDir'),
|
...(await get('modulesDir')),
|
||||||
...val ?? []
|
...val ?? []
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -18,11 +18,11 @@ export default defineUntypedSchema({
|
|||||||
* @type {boolean | typeof import('webpack-bundle-analyzer').BundleAnalyzerPlugin.Options}
|
* @type {boolean | typeof import('webpack-bundle-analyzer').BundleAnalyzerPlugin.Options}
|
||||||
*/
|
*/
|
||||||
analyze: {
|
analyze: {
|
||||||
$resolve: (val, get) => {
|
$resolve: async (val, get) => {
|
||||||
if (val !== true) {
|
if (val !== true) {
|
||||||
return val ?? false
|
return val ?? false
|
||||||
}
|
}
|
||||||
const rootDir = get('rootDir')
|
const rootDir = await get('rootDir')
|
||||||
return {
|
return {
|
||||||
template: 'treemap',
|
template: 'treemap',
|
||||||
projectRoot: rootDir,
|
projectRoot: rootDir,
|
||||||
@ -95,7 +95,7 @@ export default defineUntypedSchema({
|
|||||||
* Enables CSS source map support (defaults to `true` in development).
|
* Enables CSS source map support (defaults to `true` in development).
|
||||||
*/
|
*/
|
||||||
cssSourceMap: {
|
cssSourceMap: {
|
||||||
$resolve: (val, get) => val ?? get('dev')
|
$resolve: async (val, get) => val ?? await get('dev')
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -135,7 +135,7 @@ export default defineUntypedSchema({
|
|||||||
* Customize the options of Nuxt's integrated webpack loaders.
|
* Customize the options of Nuxt's integrated webpack loaders.
|
||||||
*/
|
*/
|
||||||
loaders: {
|
loaders: {
|
||||||
$resolve: (val, get) => {
|
$resolve: async (val, get) => {
|
||||||
const styleLoaders = [
|
const styleLoaders = [
|
||||||
'css', 'cssModules', 'less',
|
'css', 'cssModules', 'less',
|
||||||
'sass', 'scss', 'stylus', 'vueStyle'
|
'sass', 'scss', 'stylus', 'vueStyle'
|
||||||
@ -143,7 +143,7 @@ export default defineUntypedSchema({
|
|||||||
for (const name of styleLoaders) {
|
for (const name of styleLoaders) {
|
||||||
const loader = val[name]
|
const loader = val[name]
|
||||||
if (loader && loader.sourceMap === undefined) {
|
if (loader && loader.sourceMap === undefined) {
|
||||||
loader.sourceMap = Boolean(get('build.cssSourceMap'))
|
loader.sourceMap = Boolean(await get('build.cssSourceMap'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return val
|
return val
|
||||||
@ -153,14 +153,14 @@ export default defineUntypedSchema({
|
|||||||
imgUrl: { esModule: false, limit: 1000 },
|
imgUrl: { esModule: false, limit: 1000 },
|
||||||
pugPlain: {},
|
pugPlain: {},
|
||||||
vue: {
|
vue: {
|
||||||
productionMode: { $resolve: (val, get) => val ?? !get('dev') },
|
productionMode: { $resolve: async (val, get) => val ?? !(await get('dev')) },
|
||||||
transformAssetUrls: {
|
transformAssetUrls: {
|
||||||
video: 'src',
|
video: 'src',
|
||||||
source: 'src',
|
source: 'src',
|
||||||
object: 'src',
|
object: 'src',
|
||||||
embed: 'src'
|
embed: 'src'
|
||||||
},
|
},
|
||||||
compilerOptions: { $resolve: (val, get) => val ?? get('vue.compilerOptions') },
|
compilerOptions: { $resolve: async (val, get) => val ?? (await get('vue.compilerOptions')) },
|
||||||
},
|
},
|
||||||
css: {
|
css: {
|
||||||
importLoaders: 0,
|
importLoaders: 0,
|
||||||
@ -238,7 +238,7 @@ export default defineUntypedSchema({
|
|||||||
* @type {false | typeof import('css-minimizer-webpack-plugin').BasePluginOptions & typeof import('css-minimizer-webpack-plugin').DefinedDefaultMinimizerAndOptions<any>}
|
* @type {false | typeof import('css-minimizer-webpack-plugin').BasePluginOptions & typeof import('css-minimizer-webpack-plugin').DefinedDefaultMinimizerAndOptions<any>}
|
||||||
*/
|
*/
|
||||||
optimizeCSS: {
|
optimizeCSS: {
|
||||||
$resolve: (val, get) => val ?? (get('build.extractCSS') ? {} : false)
|
$resolve: async (val, get) => val ?? (await get('build.extractCSS') ? {} : false)
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -248,7 +248,7 @@ export default defineUntypedSchema({
|
|||||||
optimization: {
|
optimization: {
|
||||||
runtimeChunk: 'single',
|
runtimeChunk: 'single',
|
||||||
/** Set minimize to `false` to disable all minimizers. (It is disabled in development by default). */
|
/** Set minimize to `false` to disable all minimizers. (It is disabled in development by default). */
|
||||||
minimize: { $resolve: (val, get) => val ?? !get('dev') },
|
minimize: { $resolve: async (val, get) => val ?? !(await get('dev')) },
|
||||||
/** You can set minimizer to a customized array of plugins. */
|
/** You can set minimizer to a customized array of plugins. */
|
||||||
minimizer: undefined,
|
minimizer: undefined,
|
||||||
splitChunks: {
|
splitChunks: {
|
||||||
@ -265,10 +265,10 @@ export default defineUntypedSchema({
|
|||||||
execute: undefined,
|
execute: undefined,
|
||||||
postcssOptions: {
|
postcssOptions: {
|
||||||
config: {
|
config: {
|
||||||
$resolve: (val, get) => val ?? get('postcss.config')
|
$resolve: async (val, get) => val ?? (await get('postcss.config'))
|
||||||
},
|
},
|
||||||
plugins: {
|
plugins: {
|
||||||
$resolve: (val, get) => val ?? get('postcss.plugins')
|
$resolve: async (val, get) => val ?? (await get('postcss.plugins'))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
sourceMap: undefined,
|
sourceMap: undefined,
|
||||||
|
40
yarn.lock
40
yarn.lock
@ -428,10 +428,10 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@babel/standalone@npm:^7.18.13":
|
"@babel/standalone@npm:^7.19.0":
|
||||||
version: 7.18.13
|
version: 7.19.0
|
||||||
resolution: "@babel/standalone@npm:7.18.13"
|
resolution: "@babel/standalone@npm:7.19.0"
|
||||||
checksum: da010b1ef0d53f7888d01b3ef93aac9a17af5711979e7bc048b80bf08ae6dfa6b637bf92fee0c5753b4ff1bc3639a5b82925f9234d4e2150fc6d4d5c2ccc1f89
|
checksum: 02f808a938b8e3978fb203edfdfa0cc9ee567df173f1659de5b41a0480c857070865e45753d3ba8669d0ab26b218ab56d4ffcb05d7c5a75f7671d193331be732
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@ -1798,7 +1798,7 @@ __metadata:
|
|||||||
unbuild: latest
|
unbuild: latest
|
||||||
unctx: ^2.0.2
|
unctx: ^2.0.2
|
||||||
unimport: ^0.6.7
|
unimport: ^0.6.7
|
||||||
untyped: ^0.4.7
|
untyped: ^0.5.0
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
@ -1825,7 +1825,7 @@ __metadata:
|
|||||||
ufo: ^0.8.5
|
ufo: ^0.8.5
|
||||||
unbuild: latest
|
unbuild: latest
|
||||||
unimport: ^0.6.7
|
unimport: ^0.6.7
|
||||||
untyped: ^0.4.7
|
untyped: ^0.5.0
|
||||||
vite: ~3.1.0
|
vite: ~3.1.0
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
@ -10207,7 +10207,7 @@ __metadata:
|
|||||||
pathe: ^0.3.7
|
pathe: ^0.3.7
|
||||||
rimraf: ^3.0.2
|
rimraf: ^3.0.2
|
||||||
typescript: ^4.8.3
|
typescript: ^4.8.3
|
||||||
unbuild: ^0.8.10
|
unbuild: ^0.8.11
|
||||||
vitest: ~0.19.1
|
vitest: ~0.19.1
|
||||||
vue-tsc: ^0.39.5
|
vue-tsc: ^0.39.5
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
@ -10267,7 +10267,7 @@ __metadata:
|
|||||||
unenv: ^0.6.2
|
unenv: ^0.6.2
|
||||||
unimport: ^0.6.7
|
unimport: ^0.6.7
|
||||||
unplugin: ^0.9.2
|
unplugin: ^0.9.2
|
||||||
untyped: ^0.4.7
|
untyped: ^0.5.0
|
||||||
vue: ^3.2.39
|
vue: ^3.2.39
|
||||||
vue-bundle-renderer: ^0.4.2
|
vue-bundle-renderer: ^0.4.2
|
||||||
vue-devtools-stub: ^0.1.0
|
vue-devtools-stub: ^0.1.0
|
||||||
@ -13166,9 +13166,9 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"unbuild@npm:^0.8.10":
|
"unbuild@npm:^0.8.11":
|
||||||
version: 0.8.10
|
version: 0.8.11
|
||||||
resolution: "unbuild@npm:0.8.10"
|
resolution: "unbuild@npm:0.8.11"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@rollup/plugin-alias": ^3.1.9
|
"@rollup/plugin-alias": ^3.1.9
|
||||||
"@rollup/plugin-commonjs": ^22.0.2
|
"@rollup/plugin-commonjs": ^22.0.2
|
||||||
@ -13197,10 +13197,10 @@ __metadata:
|
|||||||
rollup-plugin-esbuild: ^4.10.1
|
rollup-plugin-esbuild: ^4.10.1
|
||||||
scule: ^0.3.2
|
scule: ^0.3.2
|
||||||
typescript: ^4.8.2
|
typescript: ^4.8.2
|
||||||
untyped: ^0.4.7
|
untyped: ^0.5.0
|
||||||
bin:
|
bin:
|
||||||
unbuild: dist/cli.mjs
|
unbuild: dist/cli.mjs
|
||||||
checksum: 77a4fde0fe1f6f7dae394be473877a5a94bf18aa992a8b79eacd7e0435bac077930f91f5a5693bd8f5d9f544e3df3b2d039d287de5d8735cfcc9191ffbb3a3d8
|
checksum: 40bcdd54d460b6d1e170a62fb71ea0eda32ca557b715d11f51acf8a2afadc4d457aecc45a00fd8ec2fba7906845cd49823720bef90000df343c8c6599ca7a52b
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@ -13370,15 +13370,15 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"untyped@npm:^0.4.7":
|
"untyped@npm:^0.5.0":
|
||||||
version: 0.4.7
|
version: 0.5.0
|
||||||
resolution: "untyped@npm:0.4.7"
|
resolution: "untyped@npm:0.5.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/core": ^7.18.13
|
"@babel/core": ^7.19.0
|
||||||
"@babel/standalone": ^7.18.13
|
"@babel/standalone": ^7.19.0
|
||||||
"@babel/types": ^7.18.13
|
"@babel/types": ^7.19.0
|
||||||
scule: ^0.3.2
|
scule: ^0.3.2
|
||||||
checksum: d5b189b19e114c4d60e122da9234c68a93d71b312a64bd8303e3aaa96f7a677befa8519ce003dec8cb587ed3e5503046131532196257ed10e647bc741532b1bc
|
checksum: db04ec68d7de032c3d6bc063bd4764dc43d0a71a275c6f854c928f589f12214e91d39dbecf119e1de84c4ba09b087e8c483c80302b4308242723d258efaddf80
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user