Skip to content

Commit e235cbb

Browse files
authored
Merge pull request #278 from AthennaIO/develop
fix: adjust vite build to set envs
2 parents 5746f05 + 9868c85 commit e235cbb

3 files changed

Lines changed: 12 additions & 18 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@athenna/core",
3-
"version": "5.41.0",
3+
"version": "5.42.0",
44
"description": "One foundation for multiple applications.",
55
"license": "MIT",
66
"author": "João Lenon <lenon@athenna.io>",

src/commands/BuildCommand.ts

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ export class BuildCommand extends BaseCommand {
6666

6767
tasks.addPromise(
6868
`Compiling static files using ${Color.yellow.bold('vite')}`,
69-
async () => {
70-
const config = await this.getViteConfig(vite)
69+
() => {
70+
const config = this.getViteConfig()
7171

7272
return vite.build(config)
7373
}
@@ -76,8 +76,8 @@ export class BuildCommand extends BaseCommand {
7676
if (Config.exists('http.vite.ssrEntrypoint')) {
7777
tasks.addPromise(
7878
`Compiling SSR entrypoint using ${Color.yellow.bold('vite')}`,
79-
async () => {
80-
const config = await this.getViteConfig(vite)
79+
() => {
80+
const config = this.getViteConfig()
8181

8282
if (!config.build) {
8383
config.build = {}
@@ -134,16 +134,10 @@ export class BuildCommand extends BaseCommand {
134134
return import('vite')
135135
}
136136

137-
public async getViteConfig(vite: any) {
138-
const { config } = await vite.loadConfigFromFile(
139-
{
140-
command: 'build',
141-
mode: 'production'
142-
},
143-
undefined,
144-
Path.pwd()
145-
)
146-
147-
return config
137+
public getViteConfig(): Record<string, any> {
138+
return {
139+
root: Path.pwd(),
140+
mode: 'production'
141+
}
148142
}
149143
}

0 commit comments

Comments
 (0)