Skip to content

Commit

Permalink
feat(build): compile ssr entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Jan 15, 2025
1 parent 321f09d commit ecabfad
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 9 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/core",
"version": "5.11.0",
"version": "5.12.0",
"description": "One foundation for multiple applications.",
"license": "MIT",
"author": "João Lenon <[email protected]>",
Expand Down Expand Up @@ -85,7 +85,7 @@
"@athenna/common": "^5.5.0",
"@athenna/config": "^5.1.0",
"@athenna/cron": "^5.4.0",
"@athenna/http": "^5.15.0",
"@athenna/http": "^5.22.0",
"@athenna/ioc": "^5.0.0",
"@athenna/logger": "^5.1.0",
"@athenna/test": "^5.2.0",
Expand Down
25 changes: 25 additions & 0 deletions src/commands/BuildCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,31 @@ export class BuildCommand extends BaseCommand {
return vite.build(config)
}
)

if (Config.exists('http.vite.ssrEntrypoint')) {
tasks.addPromise(
`Compiling SSR entrypoint using ${Color.yellow.bold('vite')}`,
async () => {
const config = await this.getViteConfig(vite)

if (!config.build) {
config.build = {}
}

if (!config.build.rollupOptions) {
config.build.rollupOptions = {}
}

config.build.ssr = true
config.build.outDir = Config.get('http.vite.ssrBuildDirectory')
config.build.rollupOptions.input = Config.get(
'http.vite.ssrEntrypoint'
)

return vite.build(config)
}
)
}
}

if (include.length) {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/ServeCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class ServeCommand extends BaseCommand {
'.vscode',
'.fleet',
'public',
'*.edge',
'src/resources/**/*',
'vite.config.{js,ts,mjs}',
'node_modules/**/node_modules'
],
Expand Down

0 comments on commit ecabfad

Please sign in to comment.