feat: allow using elk as a nuxt layer (#1665)

This commit is contained in:
Daniel Roe 2023-02-08 01:51:16 -08:00 committed by GitHub
parent a3310b6ea2
commit c25715b26d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 403 additions and 1111 deletions

View file

@ -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())
}

View file

@ -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')
},
})