mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 07:05:11 +00:00
fix(nuxt): include components runtime
dir in build output (#10046)
This commit is contained in:
parent
72bfcdfd69
commit
698a3103e0
@ -12,6 +12,7 @@ export default defineBuildConfig({
|
||||
...[
|
||||
'core',
|
||||
'head',
|
||||
'components',
|
||||
'pages'
|
||||
].map(name => ({ input: `src/${name}/runtime/`, outDir: `dist/${name}/runtime`, format: 'esm' } as BuildEntry))
|
||||
],
|
||||
|
@ -1,10 +1,12 @@
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url'
|
||||
import { pathToFileURL } from 'node:url'
|
||||
import { createUnplugin } from 'unplugin'
|
||||
import { parseQuery, parseURL } from 'ufo'
|
||||
import type { Component, ComponentsOptions } from '@nuxt/schema'
|
||||
import { genDynamicImport, genImport } from 'knitwork'
|
||||
import MagicString from 'magic-string'
|
||||
import { pascalCase } from 'scule'
|
||||
import { resolve } from 'pathe'
|
||||
import { distDir } from '../dirs'
|
||||
|
||||
interface LoaderOptions {
|
||||
getComponents (): Component[]
|
||||
@ -44,7 +46,7 @@ function isVueTemplate (id: string) {
|
||||
export const loaderPlugin = createUnplugin((options: LoaderOptions) => {
|
||||
const exclude = options.transform?.exclude || []
|
||||
const include = options.transform?.include || []
|
||||
const serverComponentRuntime = fileURLToPath(new URL('./runtime/server-component', import.meta.url))
|
||||
const serverComponentRuntime = resolve(distDir, 'components/runtime/server-component')
|
||||
|
||||
return {
|
||||
name: 'nuxt:components-loader',
|
||||
|
Loading…
Reference in New Issue
Block a user