mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-04 06:02:45 +08:00
chore: 完善依赖
This commit is contained in:
parent
5074c9e68b
commit
901fe4dd94
@ -18,7 +18,7 @@ https://tencent.github.io/tmagic-editor/playground/index.html
|
||||
|
||||
node.js >= 18
|
||||
|
||||
pnpm >= 8
|
||||
pnpm >= 9
|
||||
|
||||
先安装 pnpm
|
||||
|
||||
|
@ -38,12 +38,14 @@
|
||||
"vue"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tmagic/data-source": "workspace:*",
|
||||
"@tmagic/schema": "workspace:*",
|
||||
"@tmagic/utils": "workspace:*",
|
||||
"events": "^3.3.0",
|
||||
"lodash-es": "^4.17.21"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@tmagic/data-source": "workspace:*",
|
||||
"@tmagic/schema": "workspace:*",
|
||||
"@tmagic/utils": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/events": "^3.0.0",
|
||||
"@types/lodash-es": "^4.17.4",
|
||||
|
@ -48,7 +48,10 @@ export default defineConfig({
|
||||
rollupOptions: {
|
||||
// 确保外部化处理那些你不想打包进库的依赖
|
||||
external(id: string) {
|
||||
return Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id));
|
||||
return Object.keys({
|
||||
...pkg.dependencies,
|
||||
...pkg.peerDependencies,
|
||||
}).some((k) => new RegExp(`^${k}`).test(id));
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -35,12 +35,14 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@tmagic/dep": "workspace:*",
|
||||
"@tmagic/schema": "workspace:*",
|
||||
"@tmagic/utils": "workspace:*",
|
||||
"deep-state-observer": "^5.5.13",
|
||||
"events": "^3.3.0",
|
||||
"lodash-es": "^4.17.21"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@tmagic/schema": "workspace:*",
|
||||
"@tmagic/utils": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/events": "^3.0.0",
|
||||
"@types/lodash-es": "^4.17.4",
|
||||
|
@ -52,7 +52,10 @@ export default defineConfig(({ mode }) => ({
|
||||
if (mode === 'umd' && id === 'lodash-es') {
|
||||
return false;
|
||||
}
|
||||
return Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id));
|
||||
return Object.keys({
|
||||
...pkg.dependencies,
|
||||
...pkg.peerDependencies,
|
||||
}).some((k) => new RegExp(`^${k}`).test(id));
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -30,7 +30,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/Tencent/tmagic-editor.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"peerDependencies": {
|
||||
"@tmagic/schema": "workspace:*",
|
||||
"@tmagic/utils": "workspace:*"
|
||||
},
|
||||
|
@ -44,7 +44,7 @@ export default defineConfig({
|
||||
rollupOptions: {
|
||||
// 确保外部化处理那些你不想打包进库的依赖
|
||||
external(id: string) {
|
||||
return Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id));
|
||||
return Object.keys(pkg.peerDependencies).some((k) => new RegExp(`^${k}`).test(id));
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -37,9 +37,6 @@
|
||||
"vue3",
|
||||
"typescript"
|
||||
],
|
||||
"dependencies": {
|
||||
"vue": "^3.4.27"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "^3.4.27"
|
||||
},
|
||||
|
@ -47,7 +47,7 @@ export default defineConfig({
|
||||
rollupOptions: {
|
||||
// 确保外部化处理那些你不想打包进库的依赖
|
||||
external(id: string) {
|
||||
return Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id));
|
||||
return Object.keys(pkg.peerDependencies).some((k) => new RegExp(`^${k}`).test(id));
|
||||
},
|
||||
|
||||
output: {
|
||||
|
@ -47,14 +47,8 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@element-plus/icons-vue": "^2.3.1",
|
||||
"@tmagic/core": "workspace:*",
|
||||
"@tmagic/dep": "workspace:*",
|
||||
"@tmagic/design": "workspace:*",
|
||||
"@tmagic/form": "workspace:*",
|
||||
"@tmagic/schema": "workspace:*",
|
||||
"@tmagic/stage": "workspace:*",
|
||||
"@tmagic/table": "workspace:*",
|
||||
"@tmagic/utils": "workspace:*",
|
||||
"buffer": "^6.0.3",
|
||||
"color": "^3.1.3",
|
||||
"emmet-monaco-es": "^5.3.0",
|
||||
@ -62,14 +56,16 @@
|
||||
"gesto": "^1.19.1",
|
||||
"keycon": "^1.4.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"monaco-editor": "^0.48.0",
|
||||
"moveable": "^0.53.0",
|
||||
"serialize-javascript": "^6.0.0",
|
||||
"vue": "^3.4.27"
|
||||
"serialize-javascript": "^6.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@tmagic/core": "workspace:*",
|
||||
"@tmagic/design": "workspace:*",
|
||||
"@tmagic/form": "workspace:*",
|
||||
"@tmagic/schema": "workspace:*",
|
||||
"@tmagic/stage": "workspace:*",
|
||||
"@tmagic/utils": "workspace:*",
|
||||
"monaco-editor": "^0.48.0",
|
||||
"vue": "^3.4.27"
|
||||
},
|
||||
|
@ -63,7 +63,10 @@ export default defineConfig({
|
||||
rollupOptions: {
|
||||
// 确保外部化处理那些你不想打包进库的依赖
|
||||
external(id: string) {
|
||||
return Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id));
|
||||
return Object.keys({
|
||||
...pkg.dependencies,
|
||||
...pkg.peerDependencies,
|
||||
}).some((k) => new RegExp(`^${k}`).test(id));
|
||||
},
|
||||
|
||||
output: {
|
||||
|
@ -37,10 +37,6 @@
|
||||
"vue3",
|
||||
"typescript"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tmagic/design": "workspace:*",
|
||||
"element-plus": "^2.6.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@tmagic/design": "workspace:*",
|
||||
"element-plus": "^2.6.1"
|
||||
|
@ -35,7 +35,7 @@ export default defineConfig({
|
||||
rollupOptions: {
|
||||
// 确保外部化处理那些你不想打包进库的依赖
|
||||
external(id: string) {
|
||||
return Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id));
|
||||
return Object.keys(pkg.peerDependencies).some((k) => new RegExp(`^${k}`).test(id));
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -38,13 +38,12 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@element-plus/icons-vue": "^2.3.1",
|
||||
"@tmagic/design": "workspace:*",
|
||||
"@tmagic/utils": "workspace:*",
|
||||
"lodash-es": "^4.17.21",
|
||||
"sortablejs": "^1.15.2",
|
||||
"vue": "^3.4.27"
|
||||
"sortablejs": "^1.15.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@tmagic/design": "workspace:*",
|
||||
"@tmagic/utils": "workspace:*",
|
||||
"vue": "^3.4.27"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -51,12 +51,10 @@ export default defineConfig({
|
||||
rollupOptions: {
|
||||
// 确保外部化处理那些你不想打包进库的依赖
|
||||
external(id: string) {
|
||||
return (
|
||||
/^vue/.test(id) ||
|
||||
/^element-plus/.test(id) ||
|
||||
/^@tmagic\//.test(id) ||
|
||||
Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id))
|
||||
);
|
||||
return Object.keys({
|
||||
...pkg.dependencies,
|
||||
...pkg.peerDependencies,
|
||||
}).some((k) => new RegExp(`^${k}`).test(id));
|
||||
},
|
||||
|
||||
output: {
|
||||
|
@ -32,15 +32,17 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@scena/guides": "^0.29.2",
|
||||
"@tmagic/core": "workspace:*",
|
||||
"@tmagic/schema": "workspace:*",
|
||||
"@tmagic/utils": "workspace:*",
|
||||
"events": "^3.3.0",
|
||||
"keycon": "^1.4.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"moveable": "^0.53.0",
|
||||
"moveable-helper": "^0.4.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@tmagic/core": "workspace:*",
|
||||
"@tmagic/schema": "workspace:*",
|
||||
"@tmagic/utils": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/events": "^3.0.0",
|
||||
"@types/lodash-es": "^4.17.4",
|
||||
|
@ -49,11 +49,10 @@ export default defineConfig({
|
||||
rollupOptions: {
|
||||
// 确保外部化处理那些你不想打包进库的依赖
|
||||
external(id: string) {
|
||||
return (
|
||||
/^vue/.test(id) ||
|
||||
/^@tmagic\//.test(id) ||
|
||||
Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id))
|
||||
);
|
||||
return Object.keys({
|
||||
...pkg.dependencies,
|
||||
...pkg.peerDependencies,
|
||||
}).some((k) => new RegExp(`^${k}`).test(id));
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -35,14 +35,12 @@
|
||||
"url": "https://github.com/Tencent/tmagic-editor.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"lodash-es": "^4.17.21"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@tmagic/design": "workspace:*",
|
||||
"@tmagic/form": "workspace:*",
|
||||
"@tmagic/utils": "workspace:*",
|
||||
"lodash-es": "^4.17.21",
|
||||
"vue": "^3.4.27"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@tmagic/form": "workspace:*",
|
||||
"vue": "^3.4.27"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -51,12 +51,10 @@ export default defineConfig({
|
||||
rollupOptions: {
|
||||
// 确保外部化处理那些你不想打包进库的依赖
|
||||
external(id: string) {
|
||||
return (
|
||||
/^vue/.test(id) ||
|
||||
/^element-plus/.test(id) ||
|
||||
/^@tmagic\//.test(id) ||
|
||||
Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id))
|
||||
);
|
||||
return Object.keys({
|
||||
...pkg.dependencies,
|
||||
...pkg.peerDependencies,
|
||||
}).some((k) => new RegExp(`^${k}`).test(id));
|
||||
},
|
||||
|
||||
output: {
|
||||
|
@ -37,11 +37,6 @@
|
||||
"vue3",
|
||||
"typescript"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tmagic/design": "workspace:*",
|
||||
"tdesign-vue-next": "^1.8.1",
|
||||
"vue": "^3.4.27"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@tmagic/design": "workspace:*",
|
||||
"tdesign-vue-next": "^1.8.1",
|
||||
|
@ -38,7 +38,7 @@ export default defineConfig({
|
||||
rollupOptions: {
|
||||
// 确保外部化处理那些你不想打包进库的依赖
|
||||
external(id: string) {
|
||||
return Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id));
|
||||
return Object.keys(pkg.peerDependencies).some((k) => new RegExp(`^${k}`).test(id));
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -31,12 +31,11 @@
|
||||
"url": "https://github.com/Tencent/tmagic-editor.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tmagic/schema": "workspace:*",
|
||||
"dayjs": "^1.11.11",
|
||||
"lodash-es": "^4.17.21"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"dayjs": "^1.11.11"
|
||||
"@tmagic/schema": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/lodash-es": "^4.17.4",
|
||||
|
@ -20,8 +20,6 @@ import { defineConfig, type LibraryFormats } from 'vite';
|
||||
|
||||
import pkg from './package.json';
|
||||
|
||||
const deps = Object.keys(pkg.dependencies);
|
||||
|
||||
export default defineConfig(({ mode }) => ({
|
||||
build: {
|
||||
cssCodeSplit: false,
|
||||
@ -43,7 +41,10 @@ export default defineConfig(({ mode }) => ({
|
||||
if (mode === 'umd' && id === 'lodash-es') {
|
||||
return false;
|
||||
}
|
||||
return deps.some((k) => new RegExp(`^${k}`).test(id));
|
||||
return Object.keys({
|
||||
...pkg.dependencies,
|
||||
...pkg.peerDependencies,
|
||||
}).some((k) => new RegExp(`^${k}`).test(id));
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user