Skip to content

Commit

Permalink
fix(projects): fix plugin enable in serve
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Oct 13, 2023
1 parent a11eec6 commit 2f4cdd9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
"build": "pnpm -r --filter='./packages/*' run build",
"stub": "pnpm -r --parallel --filter='./packages/*' run stub",
"lint": "eslint . --fix",
"format": "soy prettier-format",
"format": "soy prettier-write",
"commit": "soy git-commit",
"cleanup": "soy cleanup",
"ncu": "soy ncu",
"update-pkg": "soy ncu",
"publish-pkg": "pnpm -r publish --access public",
"release": "pnpm soy release && pnpm build && pnpm publish-pkg",
"prepare": "pnpm -r run stub"
Expand Down
2 changes: 0 additions & 2 deletions packages/vue/src/context/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ export default class ElegantVueRouter {
genTransformFile(this.options);

this.generate();

this.setupFSWatcher();
}

scanPages() {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/context/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export async function genTransformFile(options: ElegantVueRouterOption) {

const transformPath = path.posix.join(options.cwd, options.transformDir);

ensureFile(transformPath);
await ensureFile(transformPath);

await writeFile(transformPath, code);
}
5 changes: 4 additions & 1 deletion packages/vue/src/unplugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ export default createUnplugin<Partial<ElegantVueRouterOption> | undefined>((opti
return {
name: '@elegant-router/vue',
enforce: 'pre',
apply: 'serve',
vite: {
apply: 'serve',
configResolved() {
ctx.setupFSWatcher();
},
configureServer(server) {
ctx.setViteServer(server);
}
Expand Down

0 comments on commit 2f4cdd9

Please sign in to comment.