-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule.ts
45 lines (40 loc) · 1.11 KB
/
module.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import {
addComponentsDir,
addImports,
addImportsDir,
addPlugin,
createResolver,
defineNuxtModule,
hasNuxtModule,
installModule,
} from '@nuxt/kit'
import { name, version } from '../package.json'
export const CONFIG_KEY = 'typo3Solr'
export default defineNuxtModule({
meta: {
configKey: CONFIG_KEY,
name,
version,
},
async setup(_options, nuxt) {
const resolver = createResolver(import.meta.url)
nuxt.options.alias['@remindgmbh/nuxt-typo3-solr'] =
resolver.resolve('runtime')
if (!hasNuxtModule('@remindgmbh/nuxt-typo3')) {
await installModule('@remindgmbh/nuxt-typo3')
}
addPlugin({
src: resolver.resolve('runtime/plugins/i18n'),
})
addImportsDir(resolver.resolve('runtime/composables/**/*'))
addImports({
as: 'T3SolrModel',
from: resolver.resolve('runtime/models'),
name: '*',
})
addComponentsDir({
path: resolver.resolve('runtime/components'),
pathPrefix: false,
})
},
})