Skip to content

Commit

Permalink
fix(vite-plugin-nitro): update plugin name, pass options to dev server (
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts authored Nov 8, 2023
1 parent ba354b9 commit f45bb80
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/vite-plugin-nitro/src/lib/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface Options {
static?: boolean;
prerender?: PrerenderOptions;
entryServer?: string;
index?: string;
}

export interface PrerenderOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('nitro', () => {
});

it('should work', () => {
expect(nitro({})[1].name).toEqual('@analogjs/vite-nitro-plugin');
expect(nitro({})[1].name).toEqual('@analogjs/vite-plugin-nitro');
});

it(`should not call the route middleware in test mode `, async () => {
Expand Down
7 changes: 5 additions & 2 deletions packages/vite-plugin-nitro/src/lib/vite-plugin-nitro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ export function nitro(options?: Options, nitroOptions?: NitroConfig): Plugin[] {

return [
(options?.ssr
? devServerPlugin({ entryServer: options?.entryServer })
? devServerPlugin({
entryServer: options?.entryServer,
index: options?.index,
})
: false) as Plugin,
{
name: '@analogjs/vite-nitro-plugin',
name: '@analogjs/vite-plugin-nitro',
async config(_config, { command }) {
isServe = command === 'serve';
isBuild = command === 'build';
Expand Down

0 comments on commit f45bb80

Please sign in to comment.