feat: allow using elk as a nuxt layer (#1665)
This commit is contained in:
parent
a3310b6ea2
commit
c25715b26d
4 changed files with 403 additions and 1111 deletions
|
@ -1,5 +1,5 @@
|
|||
import { readFile } from 'fs-extra'
|
||||
import { resolve } from 'pathe'
|
||||
import { createResolver } from '@nuxt/kit'
|
||||
import type { ManifestOptions } from 'vite-plugin-pwa'
|
||||
import { getEnv } from '../../config/env'
|
||||
import { i18n } from '../../config/i18n'
|
||||
|
@ -170,8 +170,9 @@ export const createI18n = async (): Promise<LocalizedWebManifest> => {
|
|||
}
|
||||
|
||||
async function readI18nFile(file: string) {
|
||||
const { resolve } = createResolver(import.meta.url)
|
||||
return JSON.parse(Buffer.from(
|
||||
await readFile(resolve(`./locales/${file}`), 'utf-8'),
|
||||
await readFile(resolve(`../../locales/${file}`), 'utf-8'),
|
||||
).toString())
|
||||
}
|
||||
|
||||
|
|
|
@ -4,8 +4,13 @@ import { check } from 'stale-dep'
|
|||
export default defineNuxtModule({
|
||||
meta: {
|
||||
name: 'stale-dep',
|
||||
configKey: 'staleDep',
|
||||
},
|
||||
setup() {
|
||||
return check('pnpm')
|
||||
defaults: {
|
||||
enabled: true,
|
||||
},
|
||||
setup(opts) {
|
||||
if (opts.enabled)
|
||||
return check('pnpm')
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue