mirror of https://github.com/nuxt/nuxt.git
Compare commits
2 Commits
70a622d433
...
fa3efbf918
Author | SHA1 | Date |
---|---|---|
renovate[bot] | fa3efbf918 | |
Daniel Roe | 9d77fdc802 |
18
package.json
18
package.json
|
@ -39,9 +39,9 @@
|
||||||
"@nuxt/ui-templates": "workspace:*",
|
"@nuxt/ui-templates": "workspace:*",
|
||||||
"@nuxt/vite-builder": "workspace:*",
|
"@nuxt/vite-builder": "workspace:*",
|
||||||
"@nuxt/webpack-builder": "workspace:*",
|
"@nuxt/webpack-builder": "workspace:*",
|
||||||
"@vue/compiler-core": "3.5.6",
|
"@vue/compiler-core": "3.5.7",
|
||||||
"@vue/compiler-dom": "3.5.6",
|
"@vue/compiler-dom": "3.5.7",
|
||||||
"@vue/shared": "3.5.6",
|
"@vue/shared": "3.5.7",
|
||||||
"@types/node": "20.16.5",
|
"@types/node": "20.16.5",
|
||||||
"magic-string": "^0.30.11",
|
"magic-string": "^0.30.11",
|
||||||
"nuxt": "workspace:*",
|
"nuxt": "workspace:*",
|
||||||
|
@ -51,11 +51,11 @@
|
||||||
"send": ">=0.19.0",
|
"send": ">=0.19.0",
|
||||||
"typescript": "5.6.2",
|
"typescript": "5.6.2",
|
||||||
"ufo": "1.5.4",
|
"ufo": "1.5.4",
|
||||||
"vite": "5.4.6",
|
"vite": "5.4.7",
|
||||||
"vue": "3.5.6"
|
"vue": "3.5.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "9.10.0",
|
"@eslint/js": "9.11.0",
|
||||||
"@nuxt/eslint-config": "0.5.7",
|
"@nuxt/eslint-config": "0.5.7",
|
||||||
"@nuxt/kit": "workspace:*",
|
"@nuxt/kit": "workspace:*",
|
||||||
"@nuxt/test-utils": "3.14.2",
|
"@nuxt/test-utils": "3.14.2",
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
"cssnano": "7.0.6",
|
"cssnano": "7.0.6",
|
||||||
"destr": "2.0.3",
|
"destr": "2.0.3",
|
||||||
"devalue": "5.0.0",
|
"devalue": "5.0.0",
|
||||||
"eslint": "9.10.0",
|
"eslint": "9.11.0",
|
||||||
"eslint-plugin-no-only-tests": "3.3.0",
|
"eslint-plugin-no-only-tests": "3.3.0",
|
||||||
"eslint-plugin-perfectionist": "3.6.0",
|
"eslint-plugin-perfectionist": "3.6.0",
|
||||||
"eslint-typegen": "0.3.2",
|
"eslint-typegen": "0.3.2",
|
||||||
|
@ -101,11 +101,11 @@
|
||||||
"ufo": "1.5.4",
|
"ufo": "1.5.4",
|
||||||
"vitest": "2.1.1",
|
"vitest": "2.1.1",
|
||||||
"vitest-environment-nuxt": "1.0.1",
|
"vitest-environment-nuxt": "1.0.1",
|
||||||
"vue": "3.5.6",
|
"vue": "3.5.7",
|
||||||
"vue-router": "4.4.5",
|
"vue-router": "4.4.5",
|
||||||
"vue-tsc": "2.1.6"
|
"vue-tsc": "2.1.6"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@9.10.0",
|
"packageManager": "pnpm@9.11.0",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^16.10.0 || >=18.0.0"
|
"node": "^16.10.0 || >=18.0.0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
"lodash-es": "4.17.21",
|
"lodash-es": "4.17.21",
|
||||||
"nitropack": "2.9.7",
|
"nitropack": "2.9.7",
|
||||||
"unbuild": "latest",
|
"unbuild": "latest",
|
||||||
"vite": "5.4.6",
|
"vite": "5.4.7",
|
||||||
"vitest": "2.1.1",
|
"vitest": "2.1.1",
|
||||||
"webpack": "5.94.0"
|
"webpack": "5.94.0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -85,7 +85,6 @@ export async function loadNuxtModuleInstance (nuxtModule: string | NuxtModule, n
|
||||||
|
|
||||||
// Import if input is string
|
// Import if input is string
|
||||||
if (typeof nuxtModule === 'string') {
|
if (typeof nuxtModule === 'string') {
|
||||||
let error: unknown
|
|
||||||
const paths = [join(nuxtModule, 'nuxt'), join(nuxtModule, 'module'), nuxtModule, join(nuxt.options.rootDir, nuxtModule)]
|
const paths = [join(nuxtModule, 'nuxt'), join(nuxtModule, 'module'), nuxtModule, join(nuxt.options.rootDir, nuxtModule)]
|
||||||
|
|
||||||
for (const parentURL of nuxt.options.modulesDir) {
|
for (const parentURL of nuxt.options.modulesDir) {
|
||||||
|
@ -100,16 +99,17 @@ export async function loadNuxtModuleInstance (nuxtModule: string | NuxtModule, n
|
||||||
buildTimeModuleMeta = JSON.parse(await fsp.readFile(moduleMetadataPath, 'utf-8'))
|
buildTimeModuleMeta = JSON.parse(await fsp.readFile(moduleMetadataPath, 'utf-8'))
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
} catch (_err: unknown) {
|
} catch (error: unknown) {
|
||||||
error = _err
|
const code = (error as Error & { code?: string }).code
|
||||||
|
if (code === 'MODULE_NOT_FOUND' || code === 'ERR_PACKAGE_PATH_NOT_EXPORTED' || code === 'ERR_MODULE_NOT_FOUND' || code === 'ERR_UNSUPPORTED_DIR_IMPORT') {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
logger.error(`Error while importing module \`${nuxtModule}\`: ${error}`)
|
||||||
|
throw error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (typeof nuxtModule !== 'string') { break }
|
if (typeof nuxtModule !== 'string') { break }
|
||||||
}
|
}
|
||||||
if (typeof nuxtModule !== 'function' && error) {
|
|
||||||
logger.error(`Error while importing module \`${nuxtModule}\`: ${error}`)
|
|
||||||
throw error
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Throw error if input is not a function
|
// Throw error if input is not a function
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxt/devalue": "^2.0.2",
|
"@nuxt/devalue": "^2.0.2",
|
||||||
"@nuxt/devtools": "^1.4.2",
|
"@nuxt/devtools": "^1.5.0",
|
||||||
"@nuxt/kit": "workspace:*",
|
"@nuxt/kit": "workspace:*",
|
||||||
"@nuxt/schema": "workspace:*",
|
"@nuxt/schema": "workspace:*",
|
||||||
"@nuxt/telemetry": "^2.6.0",
|
"@nuxt/telemetry": "^2.6.0",
|
||||||
|
@ -69,7 +69,7 @@
|
||||||
"@unhead/shared": "^1.11.6",
|
"@unhead/shared": "^1.11.6",
|
||||||
"@unhead/ssr": "^1.11.6",
|
"@unhead/ssr": "^1.11.6",
|
||||||
"@unhead/vue": "^1.11.6",
|
"@unhead/vue": "^1.11.6",
|
||||||
"@vue/shared": "^3.5.6",
|
"@vue/shared": "^3.5.7",
|
||||||
"acorn": "8.12.1",
|
"acorn": "8.12.1",
|
||||||
"c12": "^1.11.2",
|
"c12": "^1.11.2",
|
||||||
"chokidar": "^3.6.0",
|
"chokidar": "^3.6.0",
|
||||||
|
@ -119,7 +119,7 @@
|
||||||
"unplugin-vue-router": "^0.10.8",
|
"unplugin-vue-router": "^0.10.8",
|
||||||
"unstorage": "^1.12.0",
|
"unstorage": "^1.12.0",
|
||||||
"untyped": "^1.4.2",
|
"untyped": "^1.4.2",
|
||||||
"vue": "^3.5.6",
|
"vue": "^3.5.7",
|
||||||
"vue-bundle-renderer": "^2.1.0",
|
"vue-bundle-renderer": "^2.1.0",
|
||||||
"vue-devtools-stub": "^0.1.0",
|
"vue-devtools-stub": "^0.1.0",
|
||||||
"vue-router": "^4.4.5"
|
"vue-router": "^4.4.5"
|
||||||
|
@ -130,9 +130,9 @@
|
||||||
"@parcel/watcher": "2.4.1",
|
"@parcel/watcher": "2.4.1",
|
||||||
"@types/estree": "1.0.6",
|
"@types/estree": "1.0.6",
|
||||||
"@vitejs/plugin-vue": "5.1.4",
|
"@vitejs/plugin-vue": "5.1.4",
|
||||||
"@vue/compiler-sfc": "3.5.6",
|
"@vue/compiler-sfc": "3.5.7",
|
||||||
"unbuild": "latest",
|
"unbuild": "latest",
|
||||||
"vite": "5.4.6",
|
"vite": "5.4.7",
|
||||||
"vitest": "2.1.1"
|
"vitest": "2.1.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|
|
@ -42,8 +42,8 @@
|
||||||
"@unhead/schema": "1.11.6",
|
"@unhead/schema": "1.11.6",
|
||||||
"@vitejs/plugin-vue": "5.1.4",
|
"@vitejs/plugin-vue": "5.1.4",
|
||||||
"@vitejs/plugin-vue-jsx": "4.0.1",
|
"@vitejs/plugin-vue-jsx": "4.0.1",
|
||||||
"@vue/compiler-core": "3.5.6",
|
"@vue/compiler-core": "3.5.7",
|
||||||
"@vue/compiler-sfc": "3.5.6",
|
"@vue/compiler-sfc": "3.5.7",
|
||||||
"@vue/language-core": "2.1.6",
|
"@vue/language-core": "2.1.6",
|
||||||
"c12": "1.11.2",
|
"c12": "1.11.2",
|
||||||
"esbuild-loader": "4.2.2",
|
"esbuild-loader": "4.2.2",
|
||||||
|
@ -54,8 +54,8 @@
|
||||||
"unbuild": "latest",
|
"unbuild": "latest",
|
||||||
"unctx": "2.3.1",
|
"unctx": "2.3.1",
|
||||||
"unenv": "1.10.0",
|
"unenv": "1.10.0",
|
||||||
"vite": "5.4.6",
|
"vite": "5.4.7",
|
||||||
"vue": "3.5.6",
|
"vue": "3.5.7",
|
||||||
"vue-bundle-renderer": "2.1.0",
|
"vue-bundle-renderer": "2.1.0",
|
||||||
"vue-loader": "17.4.2",
|
"vue-loader": "17.4.2",
|
||||||
"vue-router": "4.4.5",
|
"vue-router": "4.4.5",
|
||||||
|
|
|
@ -32,6 +32,6 @@
|
||||||
"tinyexec": "0.3.0",
|
"tinyexec": "0.3.0",
|
||||||
"tinyglobby": "0.2.6",
|
"tinyglobby": "0.2.6",
|
||||||
"unocss": "0.62.4",
|
"unocss": "0.62.4",
|
||||||
"vite": "5.4.6"
|
"vite": "5.4.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
"@types/estree": "1.0.6",
|
"@types/estree": "1.0.6",
|
||||||
"rollup": "4.22.2",
|
"rollup": "4.22.2",
|
||||||
"unbuild": "latest",
|
"unbuild": "latest",
|
||||||
"vue": "3.5.6"
|
"vue": "3.5.7"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxt/kit": "workspace:*",
|
"@nuxt/kit": "workspace:*",
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
"ufo": "^1.5.4",
|
"ufo": "^1.5.4",
|
||||||
"unenv": "^1.10.0",
|
"unenv": "^1.10.0",
|
||||||
"unplugin": "^1.14.1",
|
"unplugin": "^1.14.1",
|
||||||
"vite": "^5.4.6",
|
"vite": "^5.4.7",
|
||||||
"vite-node": "^2.1.1",
|
"vite-node": "^2.1.1",
|
||||||
"vite-plugin-checker": "^0.8.0",
|
"vite-plugin-checker": "^0.8.0",
|
||||||
"vue-bundle-renderer": "^2.1.0"
|
"vue-bundle-renderer": "^2.1.0"
|
||||||
|
|
|
@ -27,11 +27,16 @@ export async function resolveCSSOptions (nuxt: Nuxt): Promise<ViteConfig['css']>
|
||||||
const pluginOptions = postcssOptions.plugins[pluginName]
|
const pluginOptions = postcssOptions.plugins[pluginName]
|
||||||
if (!pluginOptions) { continue }
|
if (!pluginOptions) { continue }
|
||||||
|
|
||||||
const path = jiti.esmResolve(pluginName)
|
let pluginFn: ((opts: Record<string, any>) => Plugin) | undefined
|
||||||
const pluginFn = (await jiti.import(path)) as (opts: Record<string, any>) => Plugin
|
for (const parentURL of nuxt.options.modulesDir) {
|
||||||
if (typeof pluginFn === 'function') {
|
pluginFn = await jiti.import(pluginName, { parentURL, try: true }) as (opts: Record<string, any>) => Plugin
|
||||||
css.postcss.plugins.push(pluginFn(pluginOptions))
|
if (typeof pluginFn === 'function') {
|
||||||
} else {
|
css.postcss.plugins.push(pluginFn(pluginOptions))
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof pluginFn !== 'function') {
|
||||||
console.warn(`[nuxt] could not import postcss plugin \`${pluginName}\`. Please report this as a bug.`)
|
console.warn(`[nuxt] could not import postcss plugin \`${pluginName}\`. Please report this as a bug.`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
"@types/webpack-bundle-analyzer": "4.7.0",
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
||||||
"@types/webpack-hot-middleware": "2.25.9",
|
"@types/webpack-hot-middleware": "2.25.9",
|
||||||
"unbuild": "latest",
|
"unbuild": "latest",
|
||||||
"vue": "3.5.6"
|
"vue": "3.5.7"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"vue": "^3.3.4"
|
"vue": "^3.3.4"
|
||||||
|
|
|
@ -49,11 +49,16 @@ export async function getPostcssConfig (nuxt: Nuxt) {
|
||||||
const pluginOptions = postcssOptions.plugins[pluginName]
|
const pluginOptions = postcssOptions.plugins[pluginName]
|
||||||
if (!pluginOptions) { continue }
|
if (!pluginOptions) { continue }
|
||||||
|
|
||||||
const path = jiti.esmResolve(pluginName)
|
let pluginFn: ((opts: Record<string, any>) => Plugin) | undefined
|
||||||
const pluginFn = (await jiti.import(path)) as (opts: Record<string, any>) => Plugin
|
for (const parentURL of nuxt.options.modulesDir) {
|
||||||
if (typeof pluginFn === 'function') {
|
pluginFn = await jiti.import(pluginName, { parentURL, try: true }) as (opts: Record<string, any>) => Plugin
|
||||||
plugins.push(pluginFn(pluginOptions))
|
if (typeof pluginFn === 'function') {
|
||||||
} else {
|
plugins.push(pluginFn(pluginOptions))
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof pluginFn !== 'function') {
|
||||||
console.warn(`[nuxt] could not import postcss plugin \`${pluginName}\`. Please report this as a bug.`)
|
console.warn(`[nuxt] could not import postcss plugin \`${pluginName}\`. Please report this as a bug.`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
741
pnpm-lock.yaml
741
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -40,7 +40,7 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
|
||||||
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"212k"`)
|
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"212k"`)
|
||||||
|
|
||||||
const modules = await analyzeSizes(['node_modules/**/*'], serverDir)
|
const modules = await analyzeSizes(['node_modules/**/*'], serverDir)
|
||||||
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"1383k"`)
|
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"1384k"`)
|
||||||
|
|
||||||
const packages = modules.files
|
const packages = modules.files
|
||||||
.filter(m => m.endsWith('package.json'))
|
.filter(m => m.endsWith('package.json'))
|
||||||
|
@ -77,7 +77,7 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
|
||||||
const serverDir = join(rootDir, '.output-inline/server')
|
const serverDir = join(rootDir, '.output-inline/server')
|
||||||
|
|
||||||
const serverStats = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
|
const serverStats = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
|
||||||
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"560k"`)
|
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"561k"`)
|
||||||
|
|
||||||
const modules = await analyzeSizes(['node_modules/**/*'], serverDir)
|
const modules = await analyzeSizes(['node_modules/**/*'], serverDir)
|
||||||
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"84.1k"`)
|
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"84.1k"`)
|
||||||
|
|
Loading…
Reference in New Issue