We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8592b1a commit 328c68dCopy full SHA for 328c68d
docs/guide/extending-routes.md
@@ -7,7 +7,18 @@ You can extend the routes at build time with the `extendRoute` or the `beforeWri
7
```ts twoslash
8
import VueRouter from 'unplugin-vue-router/vite'
9
import path from 'node:path'
10
-const __dirname = '...'
+/**
11
+ * In ESM environments, you can use `import.meta.url` to get the current file path:
12
+ *
13
+ * ```ts
14
+ * import { dirname } from 'node:path'
15
+ * import { fileURLToPath } from 'node:url'
16
17
+ * const __filename = fileURLToPath(import.meta.url)
18
+ * const __dirname = dirname(__filename)
19
+ * ```
20
+ */
21
+const __dirname: string = '...'
22
// ---cut---
23
// @moduleResolution: bundler
24
VueRouter({
0 commit comments