Skip to content

Commit

Permalink
fix(storybook): normalize win32 paths for storybook globs (#93)
Browse files Browse the repository at this point in the history
Co-authored-by: lihbr <[email protected]>
  • Loading branch information
lihbr and lihbr authored Aug 20, 2020
1 parent 675cf80 commit 658229f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"arg": "^4.1.3",
"babel-preset-vue": "^2.0.2",
"consola": "^2.15.0",
"jiti": "^0.1.11"
"jiti": "^0.1.11",
"upath": "^1.2.0"
},
"devDependencies": {
"@babel/preset-env": "latest",
Expand Down
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import path from 'path'
import fsExtra from 'fs-extra'
import upath from 'upath'
import vueOptions from '@storybook/vue/dist/server/options'
import { buildDev, buildStatic } from '@storybook/core/server'
import { requireMaybeEdge, compileTemplate, logger } from './utils'
Expand Down Expand Up @@ -171,9 +172,9 @@ function nuxtStorybookOptions (options) {
nuxtStorybookConfig.stories = [
'~/components/**/*.stories.@(ts|js)',
...nuxtStorybookConfig.stories
].map(story => story
].map(story => upath.normalize(story
.replace(/^~~/, path.relative(nuxtStorybookConfig.configDir, options.rootDir))
.replace(/^~/, path.relative(nuxtStorybookConfig.configDir, srcDir))
.replace(/^~/, path.relative(nuxtStorybookConfig.configDir, srcDir)))
)

return nuxtStorybookConfig
Expand Down

0 comments on commit 658229f

Please sign in to comment.