|
1 |
| -import { defineNuxtConfig } from "nuxt/config" |
2 |
| -import { fileURLToPath } from "url" |
3 |
| -import { addPlugin } from "@nuxt/kit" |
4 |
| -import { resolve } from "pathe" |
| 1 | +import { fileURLToPath } from 'url' |
| 2 | +import { defineNuxtConfig } from 'nuxt/config' |
| 3 | +import { addPlugin } from '@nuxt/kit' |
| 4 | +import { resolve } from 'pathe' |
5 | 5 |
|
6 |
| -const runtimeDir = fileURLToPath(new URL("./runtime", import.meta.url)) |
7 |
| -const rootDir = fileURLToPath(new URL("../../", import.meta.url)) |
| 6 | +const runtimeDir = fileURLToPath(new URL('./runtime', import.meta.url)) |
| 7 | +const rootDir = fileURLToPath(new URL('../../', import.meta.url)) |
8 | 8 |
|
9 | 9 | // https://v3.nuxtjs.org/api/configuration/nuxt.config
|
10 | 10 | export default defineNuxtConfig({
|
11 | 11 | alias: {
|
12 |
| - "@vueuse/head": `${rootDir}/src`, |
| 12 | + '@vueuse/head': `${rootDir}/src`, |
13 | 13 | },
|
14 | 14 | app: {
|
15 | 15 | head: {
|
16 |
| - title: "default title", |
| 16 | + title: 'default title', |
17 | 17 | },
|
18 | 18 | },
|
19 | 19 | workspaceDir: rootDir,
|
20 | 20 | hooks: {
|
21 |
| - "modules:before": async ({ nuxt }) => { |
| 21 | + 'modules:before': async ({ nuxt }) => { |
22 | 22 | const newModules = nuxt.options._modules
|
23 | 23 | // remove the nuxt meta (head) module
|
24 | 24 | for (const k in newModules) {
|
25 |
| - if (typeof newModules[k] === "function") { |
26 |
| - if ((await newModules[k].getMeta()).name === "meta") { |
| 25 | + if (typeof newModules[k] === 'function') { |
| 26 | + if ((await newModules[k].getMeta()).name === 'meta') { |
27 | 27 | // we can't use an undefined key so use a duplicate
|
28 |
| - newModules[k] = "@nuxt/telemetry" |
| 28 | + newModules[k] = '@nuxt/telemetry' |
29 | 29 | }
|
30 | 30 | }
|
31 | 31 | }
|
32 | 32 | nuxt.options._modules = newModules
|
33 | 33 | },
|
34 |
| - "modules:done"({ nuxt }) { |
| 34 | + 'modules:done': function ({ nuxt }) { |
35 | 35 | // Replace #head alias
|
36 |
| - nuxt.options.alias["#head"] = runtimeDir |
| 36 | + nuxt.options.alias['#head'] = runtimeDir |
37 | 37 |
|
38 |
| - addPlugin({ src: resolve(runtimeDir, "plugin") }, { append: true }) |
| 38 | + addPlugin({ src: resolve(runtimeDir, 'plugin') }, { append: true }) |
39 | 39 |
|
40 | 40 | nuxt.options.build.transpile.push(runtimeDir)
|
41 | 41 | },
|
|
0 commit comments