Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix(nuxt): include components runtime dir in build output (#10046)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Jan 11, 2023
1 parent 72bfcdf commit 698a310
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/nuxt/build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))
],
Expand Down
6 changes: 4 additions & 2 deletions packages/nuxt/src/components/loader.ts
Original file line number Diff line number Diff line change
@@ -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[]
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 698a310

Please sign in to comment.