Skip to content

Commit

Permalink
pull ssr out of asset dir
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecAivazis committed Oct 12, 2023
1 parent 13508b3 commit d3678e6
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions packages/houdini/src/vite/houdini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ export default function Plugin(opts: PluginConfig = {}): VitePlugin {
return
}

// dry
const outDir = config.routerBuildDirectory
const sourceDir = viteConfig.build.outDir

// tell the user what we're doing
console.log('🎩 Generating Deployment Assets...')

Expand All @@ -113,15 +117,20 @@ export default function Plugin(opts: PluginConfig = {}): VitePlugin {
// load the project manifest
const manifest = await load_manifest({ config, includeArtifacts: true })

// before we load the adapter we want to do some manual prep on the directories
// pull the ssr directory out of assets
await fs.recursiveCopy(path.join(sourceDir, 'ssr'), path.join(outDir, 'ssr'))
await fs.rmdir(path.join(sourceDir, 'ssr'))

// invoke the adapter
await opts.adapter({
config,
conventions: routerConventions,
sourceDir: viteConfig.build.outDir,
sourceDir,
publicBase: viteConfig.base,
outDir: config.routerBuildDirectory,
outDir,
manifest,
adapterPath: './assets/ssr/entries/adapter',
adapterPath: './ssr/entries/adapter',
})

// if there is a public directory at the root of the project,
Expand Down

0 comments on commit d3678e6

Please sign in to comment.