MCPcopy Create free account
hub / github.com/Borrus-sudo/tinypages / configureServer

Function configureServer

packages/vite/src/node/plugins/dev/markdown-dev.ts:50–68  ·  view source on GitHub ↗
(server)

Source from the content-addressed store, hash-verified

48 name: "vite-tinypages-markdown",
49 enforce: "pre",
50 configureServer(server) {
51 const eventHandler = (filePath) => {
52 if (typeof filePath === "string") {
53 const normalizedPath = path.normalize(filePath);
54 if (normalizedPath.startsWith(utils.pageDir)) {
55 refreshRouter(utils.pageDir);
56 reload("change in /pages dir", server, utils.logger);
57 seen = [];
58 } else if (
59 normalizedPath.startsWith(utils.i18nDir) &&
60 normalizedPath.includes(utils.currI18n)
61 ) {
62 reload("change in /locales dir", server, utils.logger);
63 }
64 }
65 };
66 server.watcher.addListener("add", eventHandler);
67 server.watcher.addListener("unlink", eventHandler);
68 },
69 transformIndexHtml: {
70 enforce: "pre",
71 /**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected