Skip to content

Commit

Permalink
fix: demo page 404
Browse files Browse the repository at this point in the history
  • Loading branch information
wen-haoming committed Jan 20, 2022
1 parent 48b6d6a commit c8b1d1b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion demo/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function App() {
if (aimDom) {
wrapper.current.appendChild(aimDom);
}
}, 1000);
}, 500);
}, []);

return (
Expand Down
2 changes: 1 addition & 1 deletion demo/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import VisualDev from './plugins/vite';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [VisualDev({}), react()],
plugins: [VisualDev({ noServer: true }), react()],
base: '/visual-dev',
});
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"build:ui": "cd ./packages/dev-ui && pnpm build",
"build:visual-dev": "cd ./packages/visual-dev && pnpm build",
"build:end": "node ./scripts/moveFiles.js",
"build:demo": "cd ./demo && pnpm build",
"build:demo-move-file": "node ./scripts/demo.js",
"build": "run-s build:*",
"dev": "run-p dev:*",
"start": "cd examples && cd cra-app && pnpm start",
Expand Down
1 change: 1 addition & 0 deletions packages/visual-dev/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ export interface PluginOptions {
};
devServerProxy?: Record<string, Options> | false;
mode?: 'aim';
noServer?: boolean;
}
1 change: 1 addition & 0 deletions packages/visual-dev/src/vite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const vitePlugin = (options: PluginOptions): PluginOption => {
return html;
},
buildStart() {
if (options.noServer) return;
createServer(options);
},
};
Expand Down

0 comments on commit c8b1d1b

Please sign in to comment.