diff --git a/build/build-locale.ts b/build/build-locale.ts new file mode 100644 index 00000000..e859b981 --- /dev/null +++ b/build/build-locale.ts @@ -0,0 +1,13 @@ +import fg from 'fast-glob' +import { defineConfig } from 'vite' +import { toAbsolute } from './utils' + +export default defineConfig({ + build: { + target: 'es2015', + outDir: toAbsolute('../lib/locale'), + lib: { + entry: fg.sync(toAbsolute('../src/locale/*.ts')), + }, + }, +}) diff --git a/build/sync-types.ts b/build/sync-types.ts new file mode 100644 index 00000000..680730f3 --- /dev/null +++ b/build/sync-types.ts @@ -0,0 +1,15 @@ +import fg from 'fast-glob' +import { copyFileRecursive, toAbsolute } from './utils' + +function transform(input: string) { + const outDir = input.replace(/\/types\//, '/lib/') + copyFileRecursive(input, outDir) +} + +(() => { + fg.sync([ + toAbsolute('../types/locale/*'), + toAbsolute('../types/styles/*'), + ]).map(transform) + console.log('sync-types done') +})() diff --git a/demo/I18n/base.vue b/demo/I18n/base.vue index 0634e6bb..c3d49603 100644 --- a/demo/I18n/base.vue +++ b/demo/I18n/base.vue @@ -6,7 +6,7 @@ > Switch lang - + import { computed, onMounted, onUnmounted, ref, watch } from 'vue' import { useClipboard } from '@vueuse/core' -import { useLocale } from 'element-plus' import { CaretTop, CaretBottom, DocumentCopy, VideoPlay, } from '@element-plus/icons-vue' -import { useShow } from 'element-pro-components' +import { useShow, useLocale } from 'element-pro-components' import { github } from '../utils/index' import { useStackBlitz } from '../composables/index' diff --git a/docs/src/components/PwaPopup.vue b/docs/src/components/PwaPopup.vue index 2ddc9b7d..ab1fe7dc 100644 --- a/docs/src/components/PwaPopup.vue +++ b/docs/src/components/PwaPopup.vue @@ -28,7 +28,7 @@