mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 17:35:57 +00:00
perf(schema): drop unneeded type-only schema dependencies (#30411)
This commit is contained in:
parent
ca6e31c5d6
commit
f0ce20388d
@ -20,45 +20,60 @@ export default defineBuildConfig({
|
|||||||
'src/index',
|
'src/index',
|
||||||
'src/builder-env',
|
'src/builder-env',
|
||||||
],
|
],
|
||||||
|
hooks: {
|
||||||
|
'rollup:options' (ctx, options) {
|
||||||
|
ctx.options.rollup.dts.respectExternal = false
|
||||||
|
const isExternal = options.external! as (id: string, importer?: string, isResolved?: boolean) => boolean
|
||||||
|
options.external = (source, importer, isResolved) => {
|
||||||
|
if (source === 'untyped' || source === 'knitwork') {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return isExternal(source, importer, isResolved)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
externals: [
|
externals: [
|
||||||
// Type imports
|
// Type imports
|
||||||
'nuxt/app',
|
|
||||||
'cssnano',
|
|
||||||
'autoprefixer',
|
|
||||||
'ofetch',
|
|
||||||
'vue-router',
|
|
||||||
'vue-bundle-renderer',
|
|
||||||
'@unhead/schema',
|
'@unhead/schema',
|
||||||
'vue',
|
|
||||||
'unctx',
|
|
||||||
'hookable',
|
|
||||||
'nitro',
|
|
||||||
'nitropack',
|
|
||||||
'webpack',
|
|
||||||
'webpack-bundle-analyzer',
|
|
||||||
'rollup-plugin-visualizer',
|
|
||||||
'vite',
|
|
||||||
'@vitejs/plugin-vue',
|
'@vitejs/plugin-vue',
|
||||||
'@vitejs/plugin-vue-jsx',
|
'@vitejs/plugin-vue-jsx',
|
||||||
'mini-css-extract-plugin',
|
'@vue/language-core',
|
||||||
'css-minimizer-webpack-plugin',
|
'autoprefixer',
|
||||||
'webpack-dev-middleware',
|
'c12',
|
||||||
'h3',
|
'compatx',
|
||||||
'webpack-hot-middleware',
|
|
||||||
'postcss',
|
|
||||||
'consola',
|
'consola',
|
||||||
'ignore',
|
'css-minimizer-webpack-plugin',
|
||||||
'vue-loader',
|
'cssnano',
|
||||||
'esbuild-loader',
|
'esbuild-loader',
|
||||||
'file-loader',
|
'file-loader',
|
||||||
|
'h3',
|
||||||
|
'hookable',
|
||||||
|
'ignore',
|
||||||
|
'mini-css-extract-plugin',
|
||||||
|
'nitro',
|
||||||
|
'nitropack',
|
||||||
|
'nuxt/app',
|
||||||
|
'ofetch',
|
||||||
|
'pkg-types',
|
||||||
|
'postcss',
|
||||||
'pug',
|
'pug',
|
||||||
|
'rollup-plugin-visualizer',
|
||||||
'sass-loader',
|
'sass-loader',
|
||||||
'c12',
|
'scule',
|
||||||
'@vue/language-core',
|
'unctx',
|
||||||
|
'unimport',
|
||||||
|
'vite',
|
||||||
|
'vue',
|
||||||
|
'vue-bundle-renderer',
|
||||||
|
'vue-loader',
|
||||||
|
'vue-router',
|
||||||
|
'webpack',
|
||||||
|
'webpack-bundle-analyzer',
|
||||||
|
'webpack-dev-middleware',
|
||||||
|
'webpack-hot-middleware',
|
||||||
// Implicit
|
// Implicit
|
||||||
'@vue/compiler-core',
|
'@vue/compiler-core',
|
||||||
'@vue/compiler-sfc',
|
'@vue/compiler-sfc',
|
||||||
'@vue/shared',
|
'@vue/shared',
|
||||||
'untyped',
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
@ -43,15 +43,22 @@
|
|||||||
"@vue/compiler-core": "3.5.13",
|
"@vue/compiler-core": "3.5.13",
|
||||||
"@vue/compiler-sfc": "3.5.13",
|
"@vue/compiler-sfc": "3.5.13",
|
||||||
"@vue/language-core": "2.2.0",
|
"@vue/language-core": "2.2.0",
|
||||||
|
"c12": "2.0.1",
|
||||||
|
"compatx": "0.1.8",
|
||||||
"esbuild-loader": "4.2.2",
|
"esbuild-loader": "4.2.2",
|
||||||
"file-loader": "6.2.0",
|
"file-loader": "6.2.0",
|
||||||
"h3": "npm:h3-nightly@2.0.0-1718872656.6765a6e",
|
"h3": "npm:h3-nightly@2.0.0-1718872656.6765a6e",
|
||||||
|
"hookable": "5.5.3",
|
||||||
"ignore": "7.0.0",
|
"ignore": "7.0.0",
|
||||||
"nitro": "npm:nitro-nightly@3.0.0-beta-28796231.359af68d",
|
"nitro": "npm:nitro-nightly@3.0.0-beta-28796231.359af68d",
|
||||||
"ofetch": "1.4.1",
|
"ofetch": "1.4.1",
|
||||||
|
"pkg-types": "1.3.0",
|
||||||
"sass-loader": "16.0.4",
|
"sass-loader": "16.0.4",
|
||||||
|
"scule": "1.3.0",
|
||||||
"unbuild": "3.2.0",
|
"unbuild": "3.2.0",
|
||||||
"unctx": "2.4.1",
|
"unctx": "2.4.1",
|
||||||
|
"unimport": "3.14.5",
|
||||||
|
"untyped": "1.5.2",
|
||||||
"vite": "6.0.6",
|
"vite": "6.0.6",
|
||||||
"vue": "3.5.13",
|
"vue": "3.5.13",
|
||||||
"vue-bundle-renderer": "2.1.1",
|
"vue-bundle-renderer": "2.1.1",
|
||||||
@ -61,19 +68,10 @@
|
|||||||
"webpack-dev-middleware": "7.4.2"
|
"webpack-dev-middleware": "7.4.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"c12": "^2.0.1",
|
|
||||||
"compatx": "^0.1.8",
|
|
||||||
"consola": "^3.3.3",
|
"consola": "^3.3.3",
|
||||||
"defu": "^6.1.4",
|
"defu": "^6.1.4",
|
||||||
"hookable": "^5.5.3",
|
|
||||||
"pathe": "^1.1.2",
|
"pathe": "^1.1.2",
|
||||||
"pkg-types": "^1.3.0",
|
"std-env": "^3.8.0"
|
||||||
"scule": "^1.3.0",
|
|
||||||
"std-env": "^3.8.0",
|
|
||||||
"ufo": "^1.5.4",
|
|
||||||
"uncrypto": "^0.1.3",
|
|
||||||
"unimport": "^3.14.5",
|
|
||||||
"untyped": "^1.5.2"
|
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^14.18.0 || >=16.10.0"
|
"node": "^14.18.0 || >=16.10.0"
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import { existsSync } from 'node:fs'
|
import { existsSync } from 'node:fs'
|
||||||
import { readdir } from 'node:fs/promises'
|
import { readdir } from 'node:fs/promises'
|
||||||
|
import { randomUUID } from 'node:crypto'
|
||||||
import { defineUntypedSchema } from 'untyped'
|
import { defineUntypedSchema } from 'untyped'
|
||||||
import { basename, join, relative, resolve } from 'pathe'
|
import { basename, join, relative, resolve } from 'pathe'
|
||||||
import { isDebug, isDevelopment, isTest } from 'std-env'
|
import { isDebug, isDevelopment, isTest } from 'std-env'
|
||||||
import { defu } from 'defu'
|
import { defu } from 'defu'
|
||||||
import { findWorkspaceDir } from 'pkg-types'
|
import { findWorkspaceDir } from 'pkg-types'
|
||||||
import { randomUUID } from 'uncrypto'
|
|
||||||
import type { RuntimeConfig } from '../types/config'
|
import type { RuntimeConfig } from '../types/config'
|
||||||
|
|
||||||
export default defineUntypedSchema({
|
export default defineUntypedSchema({
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { consola } from 'consola'
|
import { consola } from 'consola'
|
||||||
import { resolve } from 'pathe'
|
import { resolve } from 'pathe'
|
||||||
import { isTest } from 'std-env'
|
import { isTest } from 'std-env'
|
||||||
import { withoutLeadingSlash } from 'ufo'
|
|
||||||
import { defineUntypedSchema } from 'untyped'
|
import { defineUntypedSchema } from 'untyped'
|
||||||
|
|
||||||
export default defineUntypedSchema({
|
export default defineUntypedSchema({
|
||||||
@ -97,7 +96,7 @@ export default defineUntypedSchema({
|
|||||||
clearScreen: true,
|
clearScreen: true,
|
||||||
build: {
|
build: {
|
||||||
assetsDir: {
|
assetsDir: {
|
||||||
$resolve: async (val, get) => val ?? withoutLeadingSlash((await get('app') as Record<string, string>).buildAssetsDir),
|
$resolve: async (val, get) => val ?? (await get('app') as Record<string, string>).buildAssetsDir?.replace(/^\/+/, ''),
|
||||||
},
|
},
|
||||||
emptyOutDir: false,
|
emptyOutDir: false,
|
||||||
},
|
},
|
||||||
|
@ -650,45 +650,18 @@ importers:
|
|||||||
|
|
||||||
packages/schema:
|
packages/schema:
|
||||||
dependencies:
|
dependencies:
|
||||||
c12:
|
|
||||||
specifier: 2.0.1
|
|
||||||
version: 2.0.1(magicast@0.3.5)
|
|
||||||
compatx:
|
|
||||||
specifier: ^0.1.8
|
|
||||||
version: 0.1.8
|
|
||||||
consola:
|
consola:
|
||||||
specifier: ^3.3.3
|
specifier: ^3.3.3
|
||||||
version: 3.3.3
|
version: 3.3.3
|
||||||
defu:
|
defu:
|
||||||
specifier: ^6.1.4
|
specifier: ^6.1.4
|
||||||
version: 6.1.4
|
version: 6.1.4
|
||||||
hookable:
|
|
||||||
specifier: ^5.5.3
|
|
||||||
version: 5.5.3
|
|
||||||
pathe:
|
pathe:
|
||||||
specifier: ^1.1.2
|
specifier: ^1.1.2
|
||||||
version: 1.1.2
|
version: 1.1.2
|
||||||
pkg-types:
|
|
||||||
specifier: ^1.3.0
|
|
||||||
version: 1.3.0
|
|
||||||
scule:
|
|
||||||
specifier: ^1.3.0
|
|
||||||
version: 1.3.0
|
|
||||||
std-env:
|
std-env:
|
||||||
specifier: ^3.8.0
|
specifier: ^3.8.0
|
||||||
version: 3.8.0
|
version: 3.8.0
|
||||||
ufo:
|
|
||||||
specifier: 1.5.4
|
|
||||||
version: 1.5.4
|
|
||||||
uncrypto:
|
|
||||||
specifier: ^0.1.3
|
|
||||||
version: 0.1.3
|
|
||||||
unimport:
|
|
||||||
specifier: 3.14.5
|
|
||||||
version: 3.14.5(rollup@4.29.1)
|
|
||||||
untyped:
|
|
||||||
specifier: ^1.5.2
|
|
||||||
version: 1.5.2
|
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@types/pug':
|
'@types/pug':
|
||||||
specifier: 2.0.10
|
specifier: 2.0.10
|
||||||
@ -711,6 +684,12 @@ importers:
|
|||||||
'@vue/language-core':
|
'@vue/language-core':
|
||||||
specifier: 2.2.0
|
specifier: 2.2.0
|
||||||
version: 2.2.0(typescript@5.7.2)
|
version: 2.2.0(typescript@5.7.2)
|
||||||
|
c12:
|
||||||
|
specifier: 2.0.1
|
||||||
|
version: 2.0.1(magicast@0.3.5)
|
||||||
|
compatx:
|
||||||
|
specifier: 0.1.8
|
||||||
|
version: 0.1.8
|
||||||
esbuild-loader:
|
esbuild-loader:
|
||||||
specifier: 4.2.2
|
specifier: 4.2.2
|
||||||
version: 4.2.2(webpack@5.97.1)
|
version: 4.2.2(webpack@5.97.1)
|
||||||
@ -720,6 +699,9 @@ importers:
|
|||||||
h3:
|
h3:
|
||||||
specifier: npm:h3-nightly@2.0.0-1718872656.6765a6e
|
specifier: npm:h3-nightly@2.0.0-1718872656.6765a6e
|
||||||
version: h3-nightly@2.0.0-1718872656.6765a6e
|
version: h3-nightly@2.0.0-1718872656.6765a6e
|
||||||
|
hookable:
|
||||||
|
specifier: 5.5.3
|
||||||
|
version: 5.5.3
|
||||||
ignore:
|
ignore:
|
||||||
specifier: 7.0.0
|
specifier: 7.0.0
|
||||||
version: 7.0.0
|
version: 7.0.0
|
||||||
@ -729,15 +711,27 @@ importers:
|
|||||||
ofetch:
|
ofetch:
|
||||||
specifier: 1.4.1
|
specifier: 1.4.1
|
||||||
version: 1.4.1
|
version: 1.4.1
|
||||||
|
pkg-types:
|
||||||
|
specifier: 1.3.0
|
||||||
|
version: 1.3.0
|
||||||
sass-loader:
|
sass-loader:
|
||||||
specifier: 16.0.4
|
specifier: 16.0.4
|
||||||
version: 16.0.4(@rspack/core@1.1.8)(sass@1.78.0)(webpack@5.97.1)
|
version: 16.0.4(@rspack/core@1.1.8)(sass@1.78.0)(webpack@5.97.1)
|
||||||
|
scule:
|
||||||
|
specifier: 1.3.0
|
||||||
|
version: 1.3.0
|
||||||
unbuild:
|
unbuild:
|
||||||
specifier: 3.2.0
|
specifier: 3.2.0
|
||||||
version: 3.2.0(sass@1.78.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(vue@3.5.13(typescript@5.7.2))
|
version: 3.2.0(sass@1.78.0)(typescript@5.7.2)(vue-tsc@2.2.0(typescript@5.7.2))(vue@3.5.13(typescript@5.7.2))
|
||||||
unctx:
|
unctx:
|
||||||
specifier: 2.4.1
|
specifier: 2.4.1
|
||||||
version: 2.4.1
|
version: 2.4.1
|
||||||
|
unimport:
|
||||||
|
specifier: 3.14.5
|
||||||
|
version: 3.14.5(rollup@4.29.1)
|
||||||
|
untyped:
|
||||||
|
specifier: 1.5.2
|
||||||
|
version: 1.5.2
|
||||||
vite:
|
vite:
|
||||||
specifier: 6.0.6
|
specifier: 6.0.6
|
||||||
version: 6.0.6(@types/node@22.10.2)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1)
|
version: 6.0.6(@types/node@22.10.2)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1)
|
||||||
|
Loading…
Reference in New Issue
Block a user