diff --git a/package-lock.json b/package-lock.json index 2973961..d393c17 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@athenna/vite", - "version": "5.0.0", + "version": "5.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@athenna/vite", - "version": "5.0.0", + "version": "5.1.0", "license": "MIT", "dependencies": { "@fastify/middie": "^9.0.2", diff --git a/package.json b/package.json index 72e32fc..fae095f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@athenna/vite", - "version": "5.0.0", + "version": "5.1.0", "description": "Vite plugin for Athenna Framework.", "license": "MIT", "author": "João Lenon ", diff --git a/src/fastify/FastifyVite.ts b/src/fastify/FastifyVite.ts index 12ff2e0..42eab64 100644 --- a/src/fastify/FastifyVite.ts +++ b/src/fastify/FastifyVite.ts @@ -21,8 +21,8 @@ import { View } from '@athenna/view' import { Vite } from '#src/vite/Vite' import { EdgeError } from 'edge-error' import { Config } from '@athenna/config' -import { Options } from '@athenna/common' import type { FastifyInstance } from 'fastify' +import { Path, Options } from '@athenna/common' import type { FastifyViteOptions } from '#src/types' import { mergeConfig, type ViteDevServer } from 'vite' @@ -34,10 +34,11 @@ export class FastifyVite { public constructor(scope: FastifyInstance, options: FastifyViteOptions) { this.scope = scope this.options = Options.create(options, { + root: Path.pwd(), assetsUrl: '/assets', buildDirectory: 'public/assets', dev: Config.is('app.environment', 'production'), - manifestFile: this.options.buildDirectory + manifestFile: this.options?.buildDirectory ? path.join(this.options.buildDirectory, '.vite/manifest.json') : 'public/assets/.vite/manifest.json' })