Skip to content

Commit

Permalink
fix: remote assets
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Apr 28, 2021
1 parent 037fec0 commit 35d5696
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/slidev/node/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export function parse(

config.theme ??= headmatter.theme ?? 'default'
config.title ??= headmatter.title ?? (slides[0].content.match(/^# (.*)$/m)?.[1] || '').trim()
config.remoteAssets ??= headmatter.remoteAssets ?? 'dev'
config.remoteAssets ??= headmatter.remoteAssets ?? true
config.monaco ??= headmatter.monaco ?? 'dev'

return {
Expand Down
1 change: 1 addition & 0 deletions packages/slidev/node/plugins/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export function ViteSlidevPlugin(
},
],
resolveMode: '@fs',
awaitDownload: mode === 'build',
...remoteAssetsOptions,
})
: null,
Expand Down
4 changes: 2 additions & 2 deletions packages/slidev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"vite-plugin-components": "^0.8.4",
"vite-plugin-icons": "^0.5.0",
"vite-plugin-md": "^0.6.3",
"vite-plugin-remote-assets": "^0.1.5",
"vite-plugin-remote-assets": "^0.2.0",
"vite-plugin-windicss": "^0.15.7",
"vue": "^3.0.11",
"windicss": "^2.5.14",
Expand All @@ -93,7 +93,7 @@
"playwright": "^1.10.0",
"pnpm": "^6.2.2",
"rimraf": "^3.0.2",
"tsup": "^4.10.0",
"tsup": "^4.10.1",
"typescript": "^4.2.4"
}
}
11 changes: 10 additions & 1 deletion packages/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,17 @@ export interface ParseOptions {

export interface SlidevConfig {
title: string
/**
* @defult 'default'
*/
theme: string
remoteAssets: boolean | 'dev'
/**
* @defult true
*/
remoteAssets: boolean | 'dev' | 'build'
/**
* @defult 'dev'
*/
monaco: boolean | 'dev'
}

Expand Down
26 changes: 17 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 35d5696

Please sign in to comment.