Skip to content

Commit

Permalink
fix: escape paths on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Aug 10, 2022
1 parent 6208130 commit 976eae8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/histoire-plugin-vue/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function HstVue (): Plugin {
moduleName: '@histoire/plugin-vue',
setupFn: 'setupVue3',
importStoriesPrepend: `import { defineAsyncComponent as defineAsyncComponentVue3 } from 'vue'`,
importStoryComponent: (file, index) => `const Comp${index} = defineAsyncComponentVue3(() => import('${file.path}'))`,
importStoryComponent: (file, index) => `const Comp${index} = defineAsyncComponentVue3(() => import(${JSON.stringify(file.path)}))`,
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/histoire-plugin-vue2/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function HstVue (): Plugin {
id: 'vue2',
moduleName: '@histoire/plugin-vue2',
setupFn: 'setupVue2',
importStoryComponent: (file, index) => `const Comp${index} = () => import('${file.path}')`,
importStoryComponent: (file, index) => `const Comp${index} = () => import(${JSON.stringify(file.path)})`,
},
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function vanillaSupport (): Plugin {
id: 'vanilla',
moduleName: __dirname,
setupFn: 'setupVanilla',
importStoryComponent: (file, index) => `import Comp${index} from '${file.path}'`,
importStoryComponent: (file, index) => `import Comp${index} from ${JSON.stringify(file.path)}`, // @TODO code-splitting
},

// onDev (api) {
Expand Down

0 comments on commit 976eae8

Please sign in to comment.