Skip to content

Commit ed442a3

Browse files
authored
fix(vite-plugin): changes to config during dev (#70)
1 parent f041ac3 commit ed442a3

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/common-apples-work.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'sv-router': patch
3+
---
4+
5+
Fix vite plugin config change during development

src/vite-plugin/plugin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import { writeRouterCode } from '../gen/write-router-code.js';
77
* @returns {import('vite').Plugin}
88
*/
99
export function router(options) {
10-
if (options?.allLazy) genConfig.allLazy = options.allLazy;
11-
if (options?.js) genConfig.routesInJs = options.js;
12-
if (options?.path) genConfig.routesPath = options.path;
10+
genConfig.allLazy = options?.allLazy || false;
11+
genConfig.routesInJs = options?.js || false;
12+
genConfig.routesPath = options?.path || 'src/routes';
1313

1414
return {
1515
name: 'sv-router',

0 commit comments

Comments
 (0)