refactor(nuxt): remove #head alias (#20111)

This commit is contained in:
Daniel Roe 2023-04-07 11:36:41 +01:00 committed by GitHub
parent 9e503be0f2
commit 6ddea42f96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 15 deletions

View File

@ -38,10 +38,6 @@
"types": "./dist/app/index.d.ts", "types": "./dist/app/index.d.ts",
"import": "./dist/app/index.js" "import": "./dist/app/index.js"
}, },
"#head": {
"types": "./dist/head/runtime/index.d.ts",
"import": "./dist/head/runtime/index.js"
},
"#pages": { "#pages": {
"types": "./dist/pages/runtime/index.d.ts", "types": "./dist/pages/runtime/index.d.ts",
"import": "./dist/pages/runtime/index.js" "import": "./dist/pages/runtime/index.js"

View File

@ -14,14 +14,6 @@ export default defineNuxtModule({
// Transpile @unhead/vue // Transpile @unhead/vue
nuxt.options.build.transpile.push('@unhead/vue') nuxt.options.build.transpile.push('@unhead/vue')
// TODO: remove alias in v3.4
nuxt.options.alias['#head'] = nuxt.options.alias['#app']
nuxt.hook('prepare:types', ({ tsConfig }) => {
tsConfig.compilerOptions = tsConfig.compilerOptions || {}
delete tsConfig.compilerOptions.paths['#head']
delete tsConfig.compilerOptions.paths['#head/*']
})
// Register components // Register components
const componentsPath = resolve(runtimeDir, 'components') const componentsPath = resolve(runtimeDir, 'components')
for (const componentName of components) { for (const componentName of components) {

View File

@ -1,6 +1,3 @@
// @ts-expect-error
import { useHead } from '#head'
export default defineNuxtPlugin(() => { export default defineNuxtPlugin(() => {
useHead({ useHead({
titleTemplate: '%s - Fixture' titleTemplate: '%s - Fixture'