fix: revert upgrade to nuxt v3.2.0 (#1692)

This commit is contained in:
Daniel Roe 2023-02-10 00:32:30 +01:00 committed by GitHub
parent 44c3dd762e
commit 9578ed1e5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 421 additions and 530 deletions

View file

@ -72,6 +72,15 @@ export default defineNuxtConfig({
}, },
build: { build: {
target: 'esnext', target: 'esnext',
rollupOptions: {
output: {
manualChunks: (id) => {
// TODO: find and resolve issue in nuxt/vite/pwa
if (id.includes('.svg') || id.includes('entry'))
return 'entry'
},
},
},
}, },
}, },
postcss: { postcss: {

View file

@ -38,7 +38,6 @@
"@iconify-json/ri": "^1.1.4", "@iconify-json/ri": "^1.1.4",
"@iconify-json/twemoji": "^1.1.10", "@iconify-json/twemoji": "^1.1.10",
"@iconify/utils": "^2.0.12", "@iconify/utils": "^2.0.12",
"@nuxt/devtools": "^0.1.0",
"@nuxtjs/color-mode": "^3.2.0", "@nuxtjs/color-mode": "^3.2.0",
"@nuxtjs/i18n": "8.0.0-beta.9", "@nuxtjs/i18n": "8.0.0-beta.9",
"@pinia/nuxt": "^0.4.6", "@pinia/nuxt": "^0.4.6",
@ -107,6 +106,7 @@
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^0.34.1", "@antfu/eslint-config": "^0.34.1",
"@antfu/ni": "^0.19.0", "@antfu/ni": "^0.19.0",
"@nuxt/devtools": "^0.1.0",
"@types/chroma-js": "^2.1.4", "@types/chroma-js": "^2.1.4",
"@types/file-saver": "^2.0.5", "@types/file-saver": "^2.0.5",
"@types/fnando__sparkline": "^0.3.4", "@types/fnando__sparkline": "^0.3.4",
@ -119,7 +119,7 @@
"esno": "^0.16.3", "esno": "^0.16.3",
"fs-extra": "^11.1.0", "fs-extra": "^11.1.0",
"lint-staged": "^13.1.0", "lint-staged": "^13.1.0",
"nuxt": "3.2.0", "nuxt": "3.1.1",
"prettier": "^2.8.3", "prettier": "^2.8.3",
"simple-git-hooks": "^2.8.1", "simple-git-hooks": "^2.8.1",
"typescript": "^4.9.5", "typescript": "^4.9.5",
@ -149,7 +149,9 @@
"@tiptap/extension-paragraph": "2.0.0-beta.204", "@tiptap/extension-paragraph": "2.0.0-beta.204",
"@tiptap/extension-strike": "2.0.0-beta.204", "@tiptap/extension-strike": "2.0.0-beta.204",
"@tiptap/extension-text": "2.0.0-beta.204", "@tiptap/extension-text": "2.0.0-beta.204",
"vue": "3.2.45" "vitest>vite": "^3.2.5",
"@nuxt/kit": "^3.1.2",
"@nuxt/schema": "^3.1.2"
} }
}, },
"simple-git-hooks": { "simple-git-hooks": {

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,10 @@
import type { Driver } from 'unstorage' import type { Driver } from 'unstorage'
import memory from 'unstorage/drivers/memory' // @ts-expect-error unstorage needs to provide backwards-compatible subpath types
import _memory from 'unstorage/drivers/memory'
import { defineDriver } from 'unstorage' import { defineDriver } from 'unstorage'
const memory = _memory as typeof import('unstorage/dist/drivers/memory')['default']
export interface CacheDriverOptions { export interface CacheDriverOptions {
driver: Driver driver: Driver
} }

View file

@ -1,5 +1,7 @@
import fs from 'unstorage/drivers/fs' // @ts-expect-error unstorage needs to provide backwards-compatible subpath types
import memory from 'unstorage/drivers/memory' import _fs from 'unstorage/drivers/fs'
// @ts-expect-error unstorage needs to provide backwards-compatible subpath types
import _memory from 'unstorage/drivers/memory'
import { stringifyQuery } from 'ufo' import { stringifyQuery } from 'ufo'
@ -17,6 +19,9 @@ import { driver } from '#storage-config'
import type { AppInfo } from '~/types' import type { AppInfo } from '~/types'
import { APP_NAME } from '~/constants' import { APP_NAME } from '~/constants'
const fs = _fs as typeof import('unstorage/dist/drivers/fs')['default']
const memory = _memory as typeof import('unstorage/dist/drivers/memory')['default']
const storage = useStorage() as Storage const storage = useStorage() as Storage
if (driver === 'fs') { if (driver === 'fs') {