mirror of
https://github.com/fantastic-admin/basic.git
synced 2026-10-06 12:03:02 +08:00
refactor: 子包里使用 createRequire 动态获取 PACKAGE_NAME
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import type { ImportsMap } from 'unplugin-auto-import/types'
|
||||
import type { ComponentResolver, TypeImport } from 'unplugin-vue-components'
|
||||
import { createRequire } from 'node:module'
|
||||
|
||||
const COMPONENT_PREFIX = 'Fa'
|
||||
const PACKAGE_NAME = '@fantastic-admin/components'
|
||||
const PACKAGE_NAME = createRequire(import.meta.url)('./package.json').name
|
||||
|
||||
const BASIC_COMPONENT_NAMES = [
|
||||
'FaAlert',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
||||
"types": ["vite/client"]
|
||||
"types": ["vite/client", "node"]
|
||||
},
|
||||
"include": [
|
||||
"resolver.ts",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"type": "module",
|
||||
"version": "0.0.0",
|
||||
"exports": {
|
||||
".": "./index.ts",
|
||||
".": "./src/index.ts",
|
||||
"./resolver": "./resolver.ts"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { ImportsMap } from 'unplugin-auto-import/types'
|
||||
import { createRequire } from 'node:module'
|
||||
|
||||
const PACKAGE_NAME = '@fantastic-admin/composables'
|
||||
const PACKAGE_NAME = createRequire(import.meta.url)('./package.json').name
|
||||
|
||||
const AUTO_IMPORT_NAMES = [
|
||||
'usePagination',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
||||
"types": ["vite/client"]
|
||||
"types": ["vite/client", "node"]
|
||||
},
|
||||
"include": [
|
||||
"resolver.ts",
|
||||
|
||||
Reference in New Issue
Block a user