mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 21:55:11 +00:00
chore: improve ide dx in playground (#185)
* chore: improve ide dx in playground * fix(types): correct builder types
This commit is contained in:
parent
e3aee4bb81
commit
960523c4b8
@ -17,7 +17,7 @@ export default <Plugin> function ({ app }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createStore (arg1, arg2) {
|
export function createStore (arg1: any, arg2?: any) {
|
||||||
const store = defineStore(arg1, arg2)
|
const store = defineStore(arg1, arg2)
|
||||||
|
|
||||||
return () => useStore(store)
|
return () => useStore(store)
|
||||||
|
@ -1,17 +1,18 @@
|
|||||||
import { resolve, extname, relative } from 'path'
|
import { resolve, extname, relative } from 'path'
|
||||||
import { encodePath } from 'ufo'
|
import { encodePath } from 'ufo'
|
||||||
import { NuxtApp } from './app'
|
import { NuxtApp } from './app'
|
||||||
|
import { Builder } from './builder'
|
||||||
import { resolveFiles } from './utils'
|
import { resolveFiles } from './utils'
|
||||||
|
|
||||||
// Check if name has [slug]
|
// Check if name has [slug]
|
||||||
export interface NuxtRoute {
|
export interface NuxtRoute {
|
||||||
name: string
|
name?: string
|
||||||
path: string
|
path: string
|
||||||
file: string
|
file: string
|
||||||
children: NuxtRoute[]
|
children: NuxtRoute[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function resolvePagesRoutes (builder, app: NuxtApp) {
|
export async function resolvePagesRoutes (builder: Builder, app: NuxtApp) {
|
||||||
const pagesDir = resolve(app.dir, app.pages!.dir)
|
const pagesDir = resolve(app.dir, app.pages!.dir)
|
||||||
const pagesPattern = `${app.pages!.dir}/**/*.{${app.extensions.join(',')}}`
|
const pagesPattern = `${app.pages!.dir}/**/*.{${app.extensions.join(',')}}`
|
||||||
const files = await resolveFiles(builder, pagesPattern, app.dir)
|
const files = await resolveFiles(builder, pagesPattern, app.dir)
|
||||||
|
Loading…
Reference in New Issue
Block a user