Skip to content

Commit

Permalink
refactor(cli): support _cf option
Browse files Browse the repository at this point in the history
  • Loading branch information
haoziqaq committed Jul 7, 2024
1 parent c2156e5 commit 5f9c0b5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/varlet-cli/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export function watchTheme(
}

export function getMobileIndex() {
const isCf = window.location.origin.includes('pages.dev')
const isCf = config._cf.includes(window.location.origin)
return isCf ? './mobile' : './mobile.html'
}

Expand Down
1 change: 1 addition & 0 deletions packages/varlet-cli/src/node/config/varlet.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export interface VarletConfig {
* Directive folder name for component library.
*/
directives?: string[]
_cf?: string[]
}

export function defineConfig(config: VarletConfig) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ export default defineConfig({
themeKey: 'VARLET_V3_THEME',
defaultLightTheme: 'md3LightTheme',
defaultDarkTheme: 'md3DarkTheme',
_cf: ['pages.dev', 'varletjs.org'],
lightTheme: {
'color-body': '#fff',
'color-index-page-background': '#fff',
Expand Down

0 comments on commit 5f9c0b5

Please sign in to comment.