-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vue-playground): add custom cdn supports
- Loading branch information
1 parent
0279054
commit 4fb37e4
Showing
9 changed files
with
72 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -278,7 +278,7 @@ | |
</script> | ||
|
||
<!-- ES Module Shims: Import maps polyfill for modules browsers without import maps support (all except Chrome 89+) --> | ||
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.min.js"></script> | ||
<script async src="<!--ES_MODULE_SHIMS_CDN-->"></script> | ||
<script type="importmap"> | ||
<!--IMPORT_MAP--> | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import type {MaybeRef} from '@vueuse/core' | ||
import type {InjectionKey} from 'vue' | ||
import type {Store} from '../core' | ||
import type {PlaygroundTheme} from './utils/types-helper' | ||
import type {PlaygroundPkgCdn, PlaygroundTheme} from './utils/types-helper' | ||
|
||
export const DEFAULT_TITLE = 'Demo' as const | ||
export const PLAYGROUND_COMPONENT_NAME = 'Playground' as const | ||
|
@@ -14,6 +14,7 @@ export const CLEAR_CONSOLE_INJECT_KEY = '__clear_console__' as unknown as Inject | |
export const SHOW_IMPORT_MAP_INJECT_KEY = '__show_import_map__' as unknown as InjectionKey<MaybeRef<boolean>> | ||
export const THEME_INJECT_KEY = '__theme__' as unknown as InjectionKey<MaybeRef<PlaygroundTheme>> | ||
export const SHOW_DARK_MODE_INJECT_KEY = '__show_dark_mode__' as unknown as InjectionKey<MaybeRef<boolean>> | ||
export const PKG_CDN_INJECT_KEY = '__pkg_cdn__' as unknown as InjectionKey<MaybeRef<PlaygroundPkgCdn>> | ||
|
||
export const DEFAULT_THEME_COLOR = '#42b883' | ||
|
||
|
@@ -78,3 +79,11 @@ export const GET_DARK_THEME = (theme?: PlaygroundTheme) => { | |
...theme | ||
} as PlaygroundTheme | ||
} | ||
|
||
export const DEFAULT_VUE_RUNTIME_DOM_CDN = (version: string) => | ||
`https://unpkg.com/@vue/runtime-dom@${version}/dist/runtime-dom.esm-browser.js` | ||
|
||
export const DEFAULT_VUE_COMPILER_SFC_CDN = (version: string) => | ||
`https://unpkg.com/@vue/compiler-sfc@${version}/dist/compiler-sfc.esm-browser.js` | ||
|
||
export const DEFAULT_ES_MODULE_SHIMS_CDN = 'https://unpkg.com/[email protected]/dist/es-module-shims.min.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters