Skip to content

Commit

Permalink
Merge pull request #1 from rezozero/fix/windows-path
Browse files Browse the repository at this point in the history
fix: path join on Windows
  • Loading branch information
manuelodelain authored Jun 3, 2024
2 parents 45bcc4f + 5385cc2 commit 63dc59f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import path from 'path'
import {
defineNuxtModule,
createResolver,
Expand All @@ -9,7 +8,7 @@ import {
extendPages,
} from '@nuxt/kit'
import type { NuxtPage } from '@nuxt/schema'
import { withoutLeadingSlash, withoutTrailingSlash } from 'ufo'
import { joinURL, withoutLeadingSlash, withoutTrailingSlash } from 'ufo'
import { minimatch } from 'minimatch'
import { pascalToKebabCase } from './runtime/utils/string/pascal-to-kebab-case'

Expand All @@ -32,15 +31,15 @@ export default defineNuxtModule<NuxtStoriesOptions>({
const resolver = createResolver(import.meta.url)
const pattern = options.pattern || '**/*.stories.vue'
const root = options.root || ['components', 'stories']
const routeBasePath = path.join('/', options.route?.path || '_stories')
const routeBasePath = joinURL('/', options.route?.path || '_stories')
const route: NuxtPage = {
name: 'stories',
file: resolver.resolve('./runtime/components/StoriesPage.vue'),
...options.route,
meta: {
layout: 'stories',
},
path: path.join(routeBasePath, '/:story*'),
path: joinURL(routeBasePath, '/:story*'),
children: [] as NuxtPage[],
}

Expand Down

0 comments on commit 63dc59f

Please sign in to comment.