Skip to content

Commit

Permalink
fix: windows styles resolving
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed May 5, 2021
1 parent 097fc30 commit 0574e65
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion packages/slidev/node/plugins/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { InlineConfig, mergeConfig, Plugin } from 'vite'
import { getIndexHtml } from '../common'
import { dependencies } from '../../../client/package.json'
import { ResolvedSlidevOptions } from '../options'
import { toAtFS } from '../utils'

const EXCLUDE = [
'@slidev/types',
Expand All @@ -14,7 +15,7 @@ export function createConfigPlugin(options: ResolvedSlidevOptions): Plugin {
const injection: InlineConfig = {
resolve: {
alias: {
'@slidev/client/': `${options.clientRoot}/`,
'@slidev/client/': `${toAtFS(options.clientRoot)}/`,
},
},
optimizeDeps: {
Expand Down
9 changes: 5 additions & 4 deletions packages/slidev/node/plugins/entry.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { existsSync } from 'fs'
import { join, resolve } from 'path'
import { slash } from '@antfu/utils'
import { Plugin } from 'vite'
import { ResolvedSlidevOptions } from '../options'
import { toAtFS } from '../utils'

export function createEntryPlugin({ clientRoot, themeRoots, userRoot }: ResolvedSlidevOptions): Plugin {
const mainEntry = resolve(clientRoot, 'main.ts')
const mainEntry = slash(resolve(clientRoot, 'main.ts'))

return {
name: 'slidev:entry',
Expand All @@ -16,9 +17,9 @@ export function createEntryPlugin({ clientRoot, themeRoots, userRoot }: Resolved

async function scanStyle(root: string) {
const styles = [
join(root, 'styles/index.ts'),
join(root, 'styles/index.js'),
join(root, 'styles/index.css'),
join(root, 'styles', 'index.ts'),
join(root, 'styles', 'index.js'),
join(root, 'styles', 'index.css'),
join(root, 'styles.css'),
join(root, 'style.css'),
]
Expand Down

0 comments on commit 0574e65

Please sign in to comment.