forked from opentiny/tiny-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(chore): replace unpkg with npmmirror (opentiny#149)
* fix(chore): replace unpkg with npmmirror * fix(dev): dev environment use node_moduels * fix(chore): sync version * fix(preview): use npmmirror link * fix(preview): devtoolapi use unpkg link * fix(preview): import map add esm cdn * fix(version): fix tiny-vue version * fix(version): fix tiny-vue version * fix(version): fix tiny-vue version
- Loading branch information
1 parent
1d4c32e
commit 11e302f
Showing
5 changed files
with
41 additions
and
34 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
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 |
---|---|---|
|
@@ -18,29 +18,30 @@ const importMap = {} | |
|
||
const tinyVue3Imports = { | ||
// 推荐之后统一使用@opentiny/vue去引入依赖,兼容后续录入的组件来源于tiny-vue | ||
'@opentiny/vue': 'https://unpkg.com/@opentiny/vue@3/runtime/tiny-vue.mjs', | ||
'@opentiny/vue-icon': 'https://unpkg.com/@opentiny/vue@3/runtime/tiny-vue-icon.mjs', | ||
'@opentiny/vue-common': 'https://unpkg.com/@opentiny/vue@3/runtime/tiny-vue-common.mjs', | ||
'@opentiny/vue-locale': 'https://unpkg.com/@opentiny/vue@3/runtime/tiny-vue-locale.mjs', | ||
'@opentiny/vue-renderless/': 'https://unpkg.com/@opentiny/vue-renderless@3/' | ||
'@opentiny/vue': 'https://registry.npmmirror.com/@opentiny/vue/3.11/files/runtime/tiny-vue.mjs', | ||
'@opentiny/vue-icon': 'https://registry.npmmirror.com/@opentiny/vue/3.11/files/runtime/tiny-vue-icon.mjs', | ||
'@opentiny/vue-common': 'https://registry.npmmirror.com/@opentiny/vue/3.11/files/runtime/tiny-vue-common.mjs', | ||
'@opentiny/vue-locale': 'https://registry.npmmirror.com/@opentiny/vue/3.11/files/runtime/tiny-vue-locale.mjs', | ||
'@opentiny/vue-renderless/': 'https://esm.sh/@opentiny/vue-renderless@3.11/?raw' | ||
} | ||
|
||
importMap.imports = { | ||
vue: 'https://unpkg.com/[email protected]/dist/vue.runtime.esm-browser.js', | ||
'vue/server-renderer': 'https://unpkg.com/@vue/[email protected]/dist/server-renderer.esm-browser.js', | ||
'vue-i18n': 'https://unpkg.com/[email protected]/dist/vue-i18n.esm-browser.js', | ||
'vue-router': 'https://unpkg.com/[email protected]/dist/vue-router.esm-browser.js', | ||
'@vue/devtools-api': 'https://unpkg.com/@vue/[email protected]/lib/esm/index.js', | ||
'@vueuse/core': 'https://unpkg.com/@vueuse/[email protected]/index.mjs', | ||
'@vueuse/shared': 'https://unpkg.com/@vueuse/[email protected]/index.mjs', | ||
axios: 'https://unpkg.com/[email protected]/dist/esm/axios.js', | ||
'axios-mock-adapter': 'https://unpkg.com/[email protected]/dist/axios-mock-adapter.js', | ||
vue: 'https://registry.npmmirror.com/vue/3.2.36/files/dist/vue.esm-browser.js', | ||
'vue/server-renderer': | ||
'https://registry.npmmirror.com/vue/server-renderer/3.2.36/files/dist/server-renderer.esm-browser.js', | ||
'vue-i18n': 'https://registry.npmmirror.com/vue-i18n/9.2.0/files/dist/vue-i18n.esm-browser.js', | ||
'vue-router': 'https://registry.npmmirror.com/vue-router/4.0.16/files/dist/vue-router.esm-browser.js', | ||
'@vue/devtools-api': 'https://esm.sh/@vue/[email protected]/lib/esm/index.js?raw', | ||
'@vueuse/core': 'https://registry.npmmirror.com/@vueuse/core/9.6.0/files/index.mjs', | ||
'@vueuse/shared': 'https://registry.npmmirror.com/@vueuse/shared/9.6.0/files/index.mjs', | ||
axios: 'https://registry.npmmirror.com/axios/1.0.0-alpha.1/files/dist/esm/axios.js', | ||
'axios-mock-adapter': 'https://registry.npmmirror.com/axios-mock-adapter/1.21.1/files/dist/axios-mock-adapter.js', | ||
'@opentiny/tiny-engine-webcomponent-core': | ||
'https://unpkg.com/@opentiny/tiny-engine-webcomponent-core@1/dist/tiny-engine-webcomponent-core.es.js', | ||
'https://registry.npmmirror.com/@opentiny/tiny-engine-webcomponent-core/1/files/dist/tiny-engine-webcomponent-core.es.js', | ||
'@opentiny/tiny-engine-i18n-host': | ||
'https://unpkg.com/@opentiny/tiny-engine-i18n-host@1/dist/tiny-engine-i18n-host.es.js', | ||
'vue-demi': 'https://unpkg.com/vue-demi@0.13.11/lib/index.mjs', | ||
pinia: 'https://unpkg.com/pinia@2.0.22/dist/pinia.esm-browser.js', | ||
'https://registry.npmmirror.com/@opentiny/tiny-engine-i18n-host/1/files/dist/tiny-engine-i18n-host.es.js', | ||
'vue-demi': 'https://registry.npmmirror.com/vue-demi/0.13.11/files/lib/index.mjs', | ||
pinia: 'https://registry.npmmirror.com/pinia/2.0.22/files/dist/pinia.esm-browser.js', | ||
...tinyVue3Imports, | ||
...getSearchParams().scripts | ||
} | ||
|
24 changes: 12 additions & 12 deletions
24
packages/design-core/src/preview/src/preview/srcFiles/app.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
/** | ||
* Copyright (c) 2023 - present TinyEngine Authors. | ||
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd. | ||
* | ||
* Use of this source code is governed by an MIT-style license. | ||
* | ||
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, | ||
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR | ||
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS. | ||
* | ||
*/ | ||
* Copyright (c) 2023 - present TinyEngine Authors. | ||
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd. | ||
* | ||
* Use of this source code is governed by an MIT-style license. | ||
* | ||
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, | ||
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR | ||
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS. | ||
* | ||
*/ | ||
|
||
function addCss(href) { | ||
const link = document.createElement('link') | ||
link.setAttribute('rel', 'stylesheet') | ||
link.setAttribute('href', href) | ||
document.head.appendChild(link) | ||
} | ||
addCss('https://unpkg.com/@opentiny/vue-theme@3/index.css') | ||
addCss('https://unpkg.com/@opentiny/vue-theme-mobile@3/index.css') | ||
addCss('https://registry.npmmirror.com/@opentiny/vue-theme/3.10/files/index.css') | ||
addCss('https://registry.npmmirror.com/@opentiny/vue-theme-mobile/3.10/files/index.css') |
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