Skip to content

Commit 4877275

Browse files
committed
chore(playground): fix nuxt module resolution
1 parent ee207d1 commit 4877275

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

playgrounds/nuxt3/nuxt.config.ts

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1-
import { dirname, resolve } from 'path'
2-
import { fileURLToPath } from 'url'
31
import { defineNuxtConfig } from 'nuxt'
4-
5-
const __dirname = dirname(fileURLToPath(import.meta.url))
2+
import { resolvePath } from 'mlly'
63

74
// https://v3.nuxtjs.org/docs/directory-structure/nuxt.config
8-
export default defineNuxtConfig({
9-
alias: {
10-
'nuxt-schema-org': resolve(__dirname, '../../packages/nuxt/src/module.ts'),
11-
},
12-
modules: [
13-
'nuxt-windicss',
14-
'nuxt-schema-org',
15-
],
16-
schemaOrg: {
17-
debug: true,
18-
canonicalHost: 'https://harlanshamburgers.com/',
19-
},
5+
export default defineNuxtConfig(async () => {
6+
const resolve = (s: string) => resolvePath(s, { url: import.meta.url })
7+
const alias = {
8+
'nuxt-schema-org': await resolve('nuxt-schema-org'),
9+
// fix monorepo dependency conflicts
10+
'@vueuse/schema-org': await resolve('@vueuse/schema-org'),
11+
}
12+
return {
13+
alias,
14+
modules: [
15+
'nuxt-windicss',
16+
'nuxt-schema-org',
17+
],
18+
schemaOrg: {
19+
debug: true,
20+
canonicalHost: 'https://harlanshamburgers.com/',
21+
},
22+
}
2023
})

0 commit comments

Comments
 (0)